diff --git a/README.md b/README.md index 3915cb1d2..f0a4b2e0e 100644 --- a/README.md +++ b/README.md @@ -218,7 +218,7 @@ to a Box project, and refuses a TypeScript runtime and a Bedrock Agent import th `"box": { "version": ... }` in `agentcore.json`, which create and add runtime write, and its local box profile; build and deploy stop without them. Build derives the AgentCore Runtime profile of each runtime from its local profile. box comes from the `box-cli` archives of the public GitHub -release `v0.3.0` of [strands-agents/box](https://github.com/strands-agents/box/releases). No token +release `v0.3.2` of [strands-agents/box](https://github.com/strands-agents/box/releases). No token or account is needed to download it. Use that release's build for your machine for `agentcore dev` and the profile checks of `build`: an older box cannot read the profiles that this CLI writes. @@ -263,7 +263,7 @@ agentcore invoke --runtime agent --session-id my-box-session-0000000000000000000 agentcore logs runtime --name agent --since 15m --query '"running profile"' ``` -The CodeBuild log of the deploy shows `/tmp/box.tar.gz: OK` and `box 0.3.0`. The +The CodeBuild log of the deploy shows `/tmp/box.tar.gz: OK` and `box 0.3.2`. The second answer should say teal, and the runtime log shows `running profile ...` with no `ERROR`, `blocked by egress control` or `AccessDenied` line. For a CodeZip agent, use `--template agent-python-strands-box` and skip the container settings. diff --git a/docs/box-local-testing.md b/docs/box-local-testing.md index 999b3af83..7bfa0fcda 100644 --- a/docs/box-local-testing.md +++ b/docs/box-local-testing.md @@ -48,7 +48,7 @@ fork of [strands-agents/box](https://github.com/strands-agents/box), then run [aws/agentcore-l3-cdk-constructs#481](https://github.com/aws/agentcore-l3-cdk-constructs/pull/481): it gives the runtime's role its Memory grant, and a `PRIVATE_VPC` runtime the AgentCore endpoint of its private VPC. Without it, the box cannot reach Memory. -- `box` `0.3.0` on your `PATH`, the release the CLI pins. Use that release: the box +- `box` `0.3.2` on your `PATH`, the release the CLI pins. Use that release: the box features and the profiles that the CLI writes change together, so an older box can refuse the profiles. The CLI does not check the version of the box on your `PATH` yet. Build, deploy and dev run it to read the box profile with `box profile show --format json --full`, and CodeZip dev runs @@ -74,30 +74,30 @@ a bundle, reports its signature as invalid (`invalid Info.plist`), and kills box macOS on an Apple chip: ``` -mkdir -p ~/.local/share/box/0.3.0 && cd ~/.local/share/box/0.3.0 -curl -fSLO https://github.com/strands-agents/box/releases/download/v0.3.0/box-cli-v0.3.0-aarch64-apple-darwin.tar.gz -curl -fSLO https://github.com/strands-agents/box/releases/download/v0.3.0/SHA256SUMS.txt -grep box-cli-v0.3.0-aarch64-apple-darwin SHA256SUMS.txt | shasum -a 256 -c - -tar -xzf box-cli-v0.3.0-aarch64-apple-darwin.tar.gz +mkdir -p ~/.local/share/box/0.3.2 && cd ~/.local/share/box/0.3.2 +curl -fSLO https://github.com/strands-agents/box/releases/download/v0.3.2/box-cli-v0.3.2-aarch64-apple-darwin.tar.gz +curl -fSLO https://github.com/strands-agents/box/releases/download/v0.3.2/SHA256SUMS.txt +grep box-cli-v0.3.2-aarch64-apple-darwin SHA256SUMS.txt | shasum -a 256 -c - +tar -xzf box-cli-v0.3.2-aarch64-apple-darwin.tar.gz ``` Linux arm64: ``` -mkdir -p ~/.local/share/box/0.3.0 && cd ~/.local/share/box/0.3.0 -curl -fSLO https://github.com/strands-agents/box/releases/download/v0.3.0/box-cli-v0.3.0-aarch64-unknown-linux-gnu.tar.gz -curl -fSLO https://github.com/strands-agents/box/releases/download/v0.3.0/SHA256SUMS.txt -grep box-cli-v0.3.0-aarch64-unknown-linux-gnu SHA256SUMS.txt | sha256sum -c - -tar -xzf box-cli-v0.3.0-aarch64-unknown-linux-gnu.tar.gz +mkdir -p ~/.local/share/box/0.3.2 && cd ~/.local/share/box/0.3.2 +curl -fSLO https://github.com/strands-agents/box/releases/download/v0.3.2/box-cli-v0.3.2-aarch64-unknown-linux-gnu.tar.gz +curl -fSLO https://github.com/strands-agents/box/releases/download/v0.3.2/SHA256SUMS.txt +grep box-cli-v0.3.2-aarch64-unknown-linux-gnu SHA256SUMS.txt | sha256sum -c - +tar -xzf box-cli-v0.3.2-aarch64-unknown-linux-gnu.tar.gz ``` The check must print `OK`. Put the folder first on your `PATH`, for this shell and for new ones (use `~/.bashrc` for bash). -`BOX_VERSION` is the folder you unpacked into, `0.3.0`. +`BOX_VERSION` is the folder you unpacked into, `0.3.2`. ``` -BOX_VERSION=0.3.0 +BOX_VERSION=0.3.2 export PATH="$HOME/.local/share/box/$BOX_VERSION:$PATH" grep -q "share/box/$BOX_VERSION" ~/.zshrc || echo "export PATH=\"\$HOME/.local/share/box/$BOX_VERSION:\$PATH\"" >> ~/.zshrc ``` @@ -114,11 +114,11 @@ box --version - `which box` must name the folder you unpacked into. An older `box` earlier on your `PATH` (a source build, or Box Core's `box` in `/usr/local/bin`) wins otherwise. -- `box --version` should print the pinned `box 0.3.0` (from +- `box --version` should print the pinned `box 0.3.2` (from `src/core/project/backends/boxRelease.json`). An older box can refuse the profiles that the CLI writes. - On macOS, if Gatekeeper refuses to run `box`, clear the download flag with - `xattr -dr com.apple.quarantine "$HOME/.local/share/box/0.3.0"`. + `xattr -dr com.apple.quarantine "$HOME/.local/share/box/0.3.2"`. To move to a newer release, unpack it into its own folder the same way and change the `PATH` line to that folder. diff --git a/src/core/project/backends/boxRelease.json b/src/core/project/backends/boxRelease.json index d8aa0aed1..6c950b87f 100644 --- a/src/core/project/backends/boxRelease.json +++ b/src/core/project/backends/boxRelease.json @@ -1,16 +1,16 @@ { "box": { "repo": "strands-agents/box", - "version": "0.3.0", + "version": "0.3.2", "linux": { "target": "aarch64-unknown-linux-gnu", - "asset": "box-cli-v0.3.0-aarch64-unknown-linux-gnu.tar.gz", - "sha256": "9c7c01b22374b0041823429ba068745829ac3800db7c43b762f1836b54b40658" + "asset": "box-cli-v0.3.2-aarch64-unknown-linux-gnu.tar.gz", + "sha256": "5db4623989377c2990c639fbfa8d533546c70c67319e016ad113769dc807c985" }, "darwin": { "target": "aarch64-apple-darwin", - "asset": "box-cli-v0.3.0-aarch64-apple-darwin.tar.gz", - "sha256": "bc077119fe6b9c4ff84dffea4f895bd23531d7eda36c965aa5503131c69aaa70" + "asset": "box-cli-v0.3.2-aarch64-apple-darwin.tar.gz", + "sha256": "3f65565737411fa17f743e7beb1b39e1bc35e43f8e2755fc62595d41326f6262" } } } diff --git a/src/core/project/backends/boxRelease.test.ts b/src/core/project/backends/boxRelease.test.ts index ccdca1ca9..56671f27c 100644 --- a/src/core/project/backends/boxRelease.test.ts +++ b/src/core/project/backends/boxRelease.test.ts @@ -271,8 +271,8 @@ describe("the pinned releases", () => { test("the install hint names the box-cli archive of the pinned release", () => { // macOS and Linux come from the same release, so the hint names no other macOS release. expect(BOX_INSTALL_HINT).toBe( - "Install box: download box-cli-v0.3.0-.tar.gz for your machine from " + - "https://github.com/strands-agents/box/releases/tag/v0.3.0 (not a box-v0.3.0-* archive, " + + "Install box: download box-cli-v0.3.2-.tar.gz for your machine from " + + "https://github.com/strands-agents/box/releases/tag/v0.3.2 (not a box-v0.3.2-* archive, " + "which has no packs), unpack it into a folder (tar -xzf -C ), and add " + "that folder to your PATH.", ); diff --git a/src/core/project/manager.boxNetwork.test.ts b/src/core/project/manager.boxNetwork.test.ts index dedfb59b1..4549d832f 100644 --- a/src/core/project/manager.boxNetwork.test.ts +++ b/src/core/project/manager.boxNetwork.test.ts @@ -23,7 +23,7 @@ import { FS_RECORD_FILES, type RecordFiles } from "./boxGatewayTargets"; import { ENV_LOCAL_RELATIVE_PATH, EnvLocalFile } from "./envLocal"; import { boxGatewayLogsNotice, FsProjectManager } from "./manager"; import { ProjectSpecSchema } from "../../projectSchemas/project"; -import { renderAwsMetadataPolicy } from "./templates/boxProfile"; +import { renderAwsMetadataPolicy, tracesToRuntimeLogGroup } from "./templates/boxProfile"; import type { PassthroughGatewayCheck } from "./backends/cdk/compatibility"; /** The golden files of this suite; `RECORD=1 bun test ` rewrites them, with no AWS call. */ @@ -1626,9 +1626,14 @@ describe("build with OTEL on, as create writes a box runtime", () => { Action: ["xray:PutSpans", "xray:PutTraceSegments"], Resource: "*", }; + // The pinned box names the log group and stream of its spans (strands-agents/box#629, 0.3.2). const DEFAULT_TRACES = { kind: "cloudwatch_traces", region: "${{ inputs.aws.region }}", + ...(tracesToRuntimeLogGroup() && { + log_group: "${{ inputs.runtime.traces_log_group }}", + log_stream: "${{ inputs.runtime.traces_log_stream }}", + }), include: ["deny", "permit", "trace"], secret: { ref: "aws://" }, };