Skip to content

Commit e130074

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix-langgraph-observability
2 parents 0cf365f + 81bc380 commit e130074

391 files changed

Lines changed: 37990 additions & 2174 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-and-test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,24 @@ jobs:
4747
with:
4848
name: coverage-report
4949
path: coverage/
50+
- name: Pack tarball
51+
if: matrix.node-version == '20.x'
52+
run: npm pack
53+
- name: Install from tarball
54+
if: matrix.node-version == '20.x'
55+
run: npm install -g aws-agentcore-*.tgz
56+
- name: Verify packaged CLI runs
57+
if: matrix.node-version == '20.x'
58+
run: |
59+
agentcore --version
60+
agentcore create --name sanitytest --language Python --framework Strands --model-provider Bedrock --memory none --json
61+
test -f sanitytest/agentcore/agentcore.json
62+
- name: Upload tarball artifact
63+
if: matrix.node-version == '20.x'
64+
uses: actions/upload-artifact@v7
65+
with:
66+
name: tarball
67+
path: '*.tgz'
5068

5169
coverage:
5270
needs: build
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Cleanup PR Tarballs
2+
3+
on:
4+
schedule:
5+
# Run daily at midnight UTC
6+
- cron: '0 0 * * *'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
cleanup:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v6
18+
- name: Delete PR tarball releases older than 7 days
19+
env:
20+
GH_TOKEN: ${{ github.token }}
21+
run: |
22+
CUTOFF=$(date -u -d '7 days ago' +%Y-%m-%dT%H:%M:%SZ 2>/dev/null || date -u -v-7d +%Y-%m-%dT%H:%M:%SZ)
23+
24+
gh release list --limit 100 --json tagName,createdAt,isPrerelease \
25+
--jq '.[] | select(.isPrerelease and (.tagName | startswith("pr-")) and (.tagName | endswith("-tarball")))' \
26+
| jq -r --arg cutoff "$CUTOFF" 'select(.createdAt < $cutoff) | .tagName' \
27+
| while read -r TAG; do
28+
echo "Deleting old tarball release: $TAG"
29+
gh release delete "$TAG" --yes --cleanup-tag 2>/dev/null || true
30+
done
Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: E2E Tests (Weekly Full Suite)
1+
name: E2E Tests (Full Suite)
22
on:
33
workflow_dispatch:
44
inputs:
@@ -7,6 +7,8 @@ on:
77
default: 'us-east-1'
88
schedule:
99
- cron: '0 14 * * 1' # Every Monday at 9 AM EST (14:00 UTC)
10+
push:
11+
branches: [main]
1012

1113
concurrency:
1214
group: e2e-${{ github.event.pull_request.number || github.ref }}
@@ -21,6 +23,10 @@ jobs:
2123
runs-on: ubuntu-latest
2224
environment: e2e-testing
2325
timeout-minutes: 60
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
cdk-source: [npm, main]
2430
steps:
2531
- uses: actions/checkout@v6
2632
with:
@@ -50,11 +56,26 @@ jobs:
5056
parse-json-secrets: true
5157
- run: npm ci
5258
- run: npm run build
53-
- name: Run E2E tests
59+
- name: Build CDK package from main
60+
if: matrix.cdk-source == 'main'
61+
run: |
62+
git clone --depth 1 "https://x-access-token:${CDK_REPO_TOKEN}@github.com/${CDK_REPO}.git" /tmp/cdk-repo
63+
cd /tmp/cdk-repo
64+
npm ci
65+
npm run build
66+
TARBALL=$(npm pack --pack-destination "$RUNNER_TEMP" | tail -1)
67+
echo "CDK_TARBALL=$RUNNER_TEMP/$TARBALL" >> "$GITHUB_ENV"
68+
env:
69+
CDK_REPO_TOKEN: ${{ secrets.CDK_REPO_TOKEN }}
70+
CDK_REPO: ${{ secrets.CDK_REPO_NAME }}
71+
- name: Install CLI globally
72+
run: npm install -g "$(npm pack | tail -1)"
73+
- name: Run E2E tests (${{ matrix.cdk-source }})
5474
env:
5575
AWS_ACCOUNT_ID: ${{ steps.aws.outputs.account_id }}
5676
AWS_REGION: ${{ inputs.aws_region || 'us-east-1' }}
5777
ANTHROPIC_API_KEY: ${{ env.E2E_ANTHROPIC_API_KEY }}
5878
OPENAI_API_KEY: ${{ env.E2E_OPENAI_API_KEY }}
5979
GEMINI_API_KEY: ${{ env.E2E_GEMINI_API_KEY }}
80+
CDK_TARBALL: ${{ env.CDK_TARBALL }}
6081
run: npm run test:e2e

.github/workflows/e2e-tests.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ jobs:
4747
runs-on: ubuntu-latest
4848
environment: e2e-testing
4949
timeout-minutes: 30
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
cdk-source: [npm, main]
5054
steps:
5155
- uses: actions/checkout@v6
5256
with:
@@ -74,13 +78,32 @@ jobs:
7478
secret-ids: |
7579
E2E,${{ secrets.E2E_SECRET_ARN }}
7680
parse-json-secrets: true
81+
82+
# Build @aws/agentcore-cdk from source for cross-package testing.
83+
# Requires secrets: CDK_REPO_NAME (org/repo), CDK_REPO_TOKEN (fine-grained PAT)
84+
- name: Build CDK package from main
85+
if: matrix.cdk-source == 'main'
86+
run: |
87+
git clone --depth 1 "https://x-access-token:${CDK_REPO_TOKEN}@github.com/${CDK_REPO}.git" /tmp/cdk-repo
88+
cd /tmp/cdk-repo
89+
npm ci
90+
npm run build
91+
TARBALL=$(npm pack --pack-destination "$RUNNER_TEMP" | tail -1)
92+
echo "CDK_TARBALL=$RUNNER_TEMP/$TARBALL" >> "$GITHUB_ENV"
93+
env:
94+
CDK_REPO_TOKEN: ${{ secrets.CDK_REPO_TOKEN }}
95+
CDK_REPO: ${{ secrets.CDK_REPO_NAME }}
96+
7797
- run: npm ci
7898
- run: npm run build
79-
- name: Run E2E tests
99+
- name: Install CLI globally
100+
run: npm install -g "$(npm pack | tail -1)"
101+
- name: Run E2E tests (${{ matrix.cdk-source }})
80102
env:
81103
AWS_ACCOUNT_ID: ${{ steps.aws.outputs.account_id }}
82104
AWS_REGION: ${{ inputs.aws_region || 'us-east-1' }}
83105
ANTHROPIC_API_KEY: ${{ env.E2E_ANTHROPIC_API_KEY }}
84106
OPENAI_API_KEY: ${{ env.E2E_OPENAI_API_KEY }}
85107
GEMINI_API_KEY: ${{ env.E2E_GEMINI_API_KEY }}
108+
CDK_TARBALL: ${{ env.CDK_TARBALL }}
86109
run: npx vitest run --project e2e strands-bedrock strands-openai langgraph-bedrock googleadk-gemini

.github/workflows/pr-tarball.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: PR Tarball
2+
on:
3+
pull_request_target:
4+
branches: [main]
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
jobs:
11+
pr-tarball:
12+
runs-on: ubuntu-latest
13+
if: >-
14+
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.pull_request.author_association)
15+
steps:
16+
- uses: actions/checkout@v6
17+
with:
18+
ref: ${{ github.event.pull_request.head.sha }}
19+
- uses: actions/setup-node@v6
20+
with:
21+
node-version: '20.x'
22+
cache: 'npm'
23+
- name: Configure git
24+
run: |
25+
git config --global user.email "bedrock-agentcore-npm+ci@amazon.com"
26+
git config --global user.name "CI"
27+
- uses: astral-sh/setup-uv@v7
28+
- run: npm ci
29+
- run: npm run build --if-present
30+
- run: npm pack
31+
- name: Get tarball info
32+
id: tarball
33+
run: |
34+
TARBALL_NAME=$(ls *.tgz | head -1 | xargs basename)
35+
echo "name=$TARBALL_NAME" >> $GITHUB_OUTPUT
36+
- name: Create or update PR release
37+
id: release
38+
env:
39+
GH_TOKEN: ${{ github.token }}
40+
PR_NUMBER: ${{ github.event.pull_request.number }}
41+
TARBALL_NAME: ${{ steps.tarball.outputs.name }}
42+
run: |
43+
TAG="pr-${PR_NUMBER}-tarball"
44+
45+
# Delete existing release if it exists (to update the tarball)
46+
gh release delete "$TAG" --yes --cleanup-tag 2>/dev/null || true
47+
48+
# Create a new pre-release with the tarball
49+
gh release create "$TAG" \
50+
"${TARBALL_NAME}" \
51+
--title "PR #${PR_NUMBER} Tarball" \
52+
--notes "Auto-generated tarball for PR #${PR_NUMBER}." \
53+
--prerelease \
54+
--target "${{ github.event.pull_request.head.sha }}"
55+
56+
DOWNLOAD_URL="https://github.com/${{ github.repository }}/releases/download/${TAG}/${TARBALL_NAME}"
57+
echo "url=$DOWNLOAD_URL" >> $GITHUB_OUTPUT
58+
- name: Comment on PR
59+
uses: marocchino/sticky-pull-request-comment@v3
60+
with:
61+
header: tarball
62+
message: |
63+
## Package Tarball
64+
65+
**[${{ steps.tarball.outputs.name }}](${{ steps.release.outputs.url }})**
66+
67+
### How to install
68+
69+
```bash
70+
npm install ${{ steps.release.outputs.url }}
71+
```

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@ workdir-tmp/
6060
bun.lock
6161

6262
.agentreview
63+
ProtocolTesting/

.mcp.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"mcpServers": {
3+
"tui-harness": {
4+
"type": "http",
5+
"url": "http://127.0.0.1:24100/mcp"
6+
}
7+
}
8+
}

AGENTS.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,20 @@ Note: CDK L3 constructs are in a separate package `@aws/agentcore-cdk`.
2424
## CLI Commands
2525

2626
- `create` - Create new AgentCore project
27-
- `add` - Add resources (agent, memory, identity, target)
28-
- `remove` - Remove resources (agent, memory, identity, target, all)
27+
- `add` - Add resources (agent, memory, identity, evaluator, online-eval, target)
28+
- `remove` - Remove resources (agent, memory, identity, evaluator, online-eval, target, all)
2929
- `deploy` - Deploy infrastructure to AWS
3030
- `status` - Check deployment status
3131
- `dev` - Local development server (CodeZip: uvicorn with hot-reload; Container: Docker build + run with volume mount)
3232
- `invoke` - Invoke agents (local or deployed)
33+
- `run eval` - Run on-demand evaluation against agent sessions
34+
- `evals history` - View past eval run results
35+
- `pause online-eval` - Pause (disable) a deployed online eval config
36+
- `resume online-eval` - Resume (enable) a paused online eval config
37+
- `logs` - Stream or search agent runtime logs
38+
- `logs evals` - Stream or search online eval logs
39+
- `traces list` - List recent traces for a deployed agent
40+
- `traces get` - Download a trace to a JSON file
3341
- `package` - Package agent artifacts without deploying (zip for CodeZip, container image build for Container)
3442
- `validate` - Validate configuration files
3543
- `update` - Check for CLI updates
@@ -40,21 +48,20 @@ Note: CDK L3 constructs are in a separate package `@aws/agentcore-cdk`.
4048
- **Template agents**: Created from framework templates (Strands, LangChain_LangGraph, CrewAI, GoogleADK, OpenAIAgents,
4149
AutoGen)
4250
- **BYO agents**: Bring your own code with `agentcore add agent --type byo`
51+
- **Imported agents**: Import from Bedrock Agents with `agentcore add agent --type import`
4352

4453
### Build Types
4554

4655
- **CodeZip**: Python source is packaged into a zip artifact and deployed to AgentCore Runtime (default)
4756
- **Container**: Agent is built as a Docker container image, deployed via ECR and CodeBuild. Requires a `Dockerfile` in
4857
the agent's code directory. Supported container runtimes: Docker, Podman, Finch.
4958

50-
### Coming Soon
51-
52-
- MCP gateway and tool support (`add gateway`, `add mcp-tool`) - currently hidden
53-
5459
## Primitives Architecture
5560

56-
All resource types (agent, memory, identity, gateway, mcp-tool) are modeled as **primitives** — self-contained classes
57-
in `src/cli/primitives/` that own the full add/remove lifecycle for their resource type.
61+
All resource types (agent, memory, identity, evaluator, online-eval, gateway, mcp-tool) are modeled as **primitives** --
62+
self-contained classes in `src/cli/primitives/` that own the full add/remove lifecycle for their resource type.
63+
Resources support config-driven tagging via `agentcore.json` and `mcp.json`, with tags flowing through to deployed
64+
CloudFormation resources.
5865

5966
Each primitive extends `BasePrimitive` and implements: `add()`, `remove()`, `previewRemove()`, `getRemovable()`,
6067
`registerCommands()`, and `addScreen()`.
@@ -64,8 +71,10 @@ Current primitives:
6471
- `AgentPrimitive` — agent creation (template + BYO), removal, credential resolution
6572
- `MemoryPrimitive` — memory creation with strategies, removal
6673
- `CredentialPrimitive` — credential/identity creation, .env management, removal
67-
- `GatewayPrimitive` — MCP gateway creation/removal (hidden, coming soon)
68-
- `GatewayTargetPrimitive` — MCP tool creation/removal with code generation (hidden, coming soon)
74+
- `EvaluatorPrimitive` — custom evaluator creation/removal with cross-reference validation
75+
- `OnlineEvalConfigPrimitive` — online eval config creation/removal
76+
- `GatewayPrimitive` — MCP gateway creation/removal
77+
- `GatewayTargetPrimitive` — MCP tool creation/removal with code generation
6978

7079
Singletons are created in `registry.ts` and wired into CLI commands via `cli.ts`. See `src/cli/AGENTS.md` for details on
7180
adding new primitives.
@@ -121,3 +130,8 @@ See `docs/TESTING.md` for details.
121130

122131
- Always look for existing types before creating a new type inline.
123132
- Re-usable constants must be defined in a constants file in the closest sensible subdirectory.
133+
134+
## TUI Harness
135+
136+
See `docs/tui-harness.md` for the full TUI harness usage guide (MCP tools, screen markers, examples, and error
137+
recovery).

0 commit comments

Comments
 (0)