Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ jobs:
matrix:
variant: [Released, Prerelease]
build: [GA, Preview]
# The prerelease channel produces a single tarball (GA and preview builds are
# identical post-cutover), so there is no separate prerelease preview artifact.
# Released/Preview is kept — it verifies the @preview npm tag stays publishable.
exclude:
- variant: Prerelease
build: Preview
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
Expand Down Expand Up @@ -72,7 +78,6 @@ jobs:
"Released/GA") SPEC="@aws/agentcore" ;;
"Released/Preview") SPEC="@aws/agentcore@preview" ;;
"Prerelease/GA") SPEC="${PRERELEASE_BASE_URL}/agentcore-cli-prerelease.tgz" ;;
"Prerelease/Preview") SPEC="${PRERELEASE_BASE_URL}/agentcore-cli-prerelease-preview.tgz" ;;
*) echo "Unknown variant/build combination" >&2; exit 1 ;;
esac
echo "Installing: $SPEC"
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/e2e-tests-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
strategy:
fail-fast: false
matrix:
cli-build: [preview, ga]
shard: ['1/5', '2/5', '3/5', '4/5', '5/5']
steps:
- uses: actions/checkout@v6
Expand Down Expand Up @@ -60,10 +59,8 @@ jobs:
E2E,${{ secrets.E2E_SECRET_ARN }}
parse-json-secrets: true
- run: npm ci
- name: Build CLI (${{ matrix.cli-build }})
- name: Build CLI
run: npm run build
env:
BUILD_PREVIEW: ${{ matrix.cli-build == 'preview' && '1' || '0' }}
- name: Generate GitHub App Token
id: app-token
uses: actions/create-github-app-token@v3
Expand Down Expand Up @@ -97,7 +94,7 @@ jobs:
CDK_REPO: ${{ secrets.CDK_REPO_NAME }}
- name: Install CLI globally
run: npm install -g "$(npm pack | tail -1)"
- name: Run E2E tests (${{ matrix.cli-build }}, shard ${{ matrix.shard }})
- name: Run E2E tests (shard ${{ matrix.shard }})
env:
AWS_ACCOUNT_ID: ${{ steps.aws.outputs.account_id }}
AWS_REGION: ${{ inputs.aws_region || 'us-east-1' }}
Expand All @@ -112,8 +109,6 @@ jobs:
CDP_API_KEY_ID: ${{ env.E2E_CDP_API_KEY_ID }}
CDP_API_KEY_SECRET: ${{ env.E2E_CDP_API_KEY_SECRET }}
CDP_WALLET_SECRET: ${{ env.E2E_CDP_WALLET_SECRET }}
BUILD_PREVIEW: ${{ matrix.cli-build == 'preview' && '1' || '0' }}

run: npx vitest run --project e2e --shard=${{ matrix.shard }}
browser-tests:
runs-on: ubuntu-latest
Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,16 @@ jobs:

- run: npm ci

- name: Bundle GA and preview tarballs
- name: Bundle tarball
run: |
npm run bundle
GA_TARBALL=$(ls aws-agentcore-*.tgz | grep -v preview | head -1)
PREVIEW_TARBALL=$(ls aws-agentcore-*-preview-*.tgz | head -1)
echo "GA_TARBALL=$PWD/$GA_TARBALL" >> "$GITHUB_ENV"
echo "PREVIEW_TARBALL=$PWD/$PREVIEW_TARBALL" >> "$GITHUB_ENV"
TARBALL=$(ls aws-agentcore-*.tgz | head -1)
echo "TARBALL=$PWD/$TARBALL" >> "$GITHUB_ENV"
env:
AGENTCORE_CDK_PATH: /tmp/cdk-repo

- name: Install GA CLI globally
run: npm install -g "$GA_TARBALL"
- name: Install CLI globally
run: npm install -g "$TARBALL"

- name: Detect changed e2e test files
id: changed
Expand Down Expand Up @@ -166,10 +164,7 @@ jobs:
npx vitest run --project e2e e2e-tests/strands-bedrock.test.ts e2e-tests/payment-strands-bedrock.test.ts ${{
steps.changed.outputs.ga_extra }}

- name: Install preview CLI globally
run: npm install -g "$PREVIEW_TARBALL"

- name: Run E2E tests (preview/harness)
- name: Run E2E tests (harness)
env:
AWS_ACCOUNT_ID: ${{ steps.aws.outputs.account_id }}
AWS_REGION: ${{ inputs.aws_region || 'us-east-1' }}
Expand All @@ -180,5 +175,4 @@ jobs:
E2E_S3_ACCESS_POINT_ARN: ${{ env.E2E_S3_ACCESS_POINT_ARN }}
E2E_FILESYSTEM_SUBNET_ID: ${{ env.E2E_FILESYSTEM_SUBNET_ID }}
E2E_FILESYSTEM_SECURITY_GROUP_ID: ${{ env.E2E_FILESYSTEM_SECURITY_GROUP_ID }}
BUILD_PREVIEW: '1'
run: npx vitest run --project e2e e2e-tests/harness-bedrock.test.ts ${{ steps.changed.outputs.harness_extra }}
Comment thread
avi-alpert marked this conversation as resolved.
11 changes: 2 additions & 9 deletions .github/workflows/prerelease-tarball.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,16 @@ jobs:
# Delete existing release if it exists (to update the tarballs)
gh release delete "$TAG" --yes --cleanup-tag 2>/dev/null || true

# Create a new pre-release with both tarballs
# Create a new pre-release with the tarball
gh release create "$TAG" \
"${TARBALL_BASE}.tgz" \
"${TARBALL_BASE}-preview.tgz" \
--title "Prerelease" \
--notes "Auto-generated tarballs from the latest commit on main.
--notes "Auto-generated tarball from the latest commit on main.

Version: \`${VERSION_SUFFIX}\` (cli-cdk)

**GA build** (no harness features):
\`\`\`
npm install -g https://github.com/aws/agentcore-cli/releases/download/prerelease/${TARBALL_BASE}.tgz
\`\`\`

**Preview build** (harness features enabled):
\`\`\`
npm install -g https://github.com/aws/agentcore-cli/releases/download/prerelease/${TARBALL_BASE}-preview.tgz
\`\`\`" \
--prerelease \
--target "${{ github.sha }}"
2 changes: 0 additions & 2 deletions .github/workflows/release-main-and-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,6 @@ jobs:
echo "Set package.json version to $VERSION for preview publish"

- name: Build package
env:
BUILD_PREVIEW: '1'
run: npm run build

- name: Publish to npm
Expand Down
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,7 @@ clusters of bad outcomes.
| `resume online-insights` | Resume a paused online insights config |
| `archive insights` | Delete an insights job on the service + clear local history |

### Harness — `[preview]`

> Harness commands are only available in the preview release of the CLI. Install it with:
>
> ```bash
> npm install -g @aws/agentcore@preview
> ```
### Harness

A harness bundles a runtime, model, tools, skills, memory, and observability into one declarative config. Use it when
you want infra without writing agent code.
Expand Down
7 changes: 2 additions & 5 deletions e2e-tests/harness-e2e-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import { join } from 'node:path';
import { afterAll, beforeAll, describe, expect, it } from 'vitest';

const hasAws = hasAwsCredentials();
// Harness features are only available in preview builds (BUILD_PREVIEW=1).
const isPreviewBuild = process.env.BUILD_PREVIEW === '1';
const baseCanRun = prereqs.npm && prereqs.git && hasAws && isPreviewBuild;
const baseCanRun = prereqs.npm && prereqs.git && hasAws;
Comment thread
avi-alpert marked this conversation as resolved.

interface HarnessE2EConfig {
modelProvider: 'bedrock' | 'open_ai' | 'gemini';
Expand All @@ -33,8 +31,7 @@ export function createHarnessE2ESuite(cfg: HarnessE2EConfig) {
if (!canRun) {
logger.warn(
`tests are skipped due to insufficient conditions. ` +
`npm=${prereqs.npm}, git=${prereqs.git}, hasAws=${hasAws}, ` +
`isPreviewBuild=${isPreviewBuild}, hasRequiredVar=${hasRequiredVar}`
`npm=${prereqs.npm}, git=${prereqs.git}, hasAws=${hasAws}, hasRequiredVar=${hasRequiredVar}`
);
}

Expand Down
3 changes: 0 additions & 3 deletions esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ await esbuild.build({
minify: true,
keepNames: true,
jsx: 'automatic',
define: {
__PREVIEW__: process.env.BUILD_PREVIEW === '1' ? 'true' : 'false',
},
// Inject require shim for ESM compatibility with CommonJS dependencies
banner: {
js: `import { createRequire } from 'module'; import { fileURLToPath as __ef } from 'url'; import { dirname as __ed } from 'path'; const require = createRequire(import.meta.url); const __filename = __ef(import.meta.url); const __dirname = __ed(__filename);`,
Expand Down
12 changes: 4 additions & 8 deletions integ-tests/add-remove-harness.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@ import { readFile } from 'node:fs/promises';
import { join } from 'node:path';
import { afterAll, beforeAll, describe, expect, it } from 'vitest';

// Harness features are only available in preview builds (BUILD_PREVIEW=1).
// The standard CI build is GA, so skip these tests unless the preview bundle is present.
const isPreviewBuild = process.env.BUILD_PREVIEW === '1';

async function readHarnessSpec(projectPath: string, harnessName: string) {
return JSON.parse(await readFile(join(projectPath, `app/${harnessName}/harness.json`), 'utf-8'));
}

describe.skipIf(!isPreviewBuild)('integration: harness add/remove lifecycle', () => {
describe('integration: harness add/remove lifecycle', () => {
let project: TestProject;
const harnessName = 'TestHarness';

Expand Down Expand Up @@ -87,7 +83,7 @@ describe.skipIf(!isPreviewBuild)('integration: harness add/remove lifecycle', ()
});
});

describe.skipIf(!isPreviewBuild)('integration: harness configuration options', () => {
describe('integration: harness configuration options', () => {
let project: TestProject;

beforeAll(async () => {
Expand Down Expand Up @@ -167,7 +163,7 @@ describe.skipIf(!isPreviewBuild)('integration: harness configuration options', (
});
});

describe.skipIf(!isPreviewBuild)('integration: harness validation errors', () => {
describe('integration: harness validation errors', () => {
let project: TestProject;

beforeAll(async () => {
Expand All @@ -194,7 +190,7 @@ describe.skipIf(!isPreviewBuild)('integration: harness validation errors', () =>
});
});

describe.skipIf(!isPreviewBuild)('integration: create project with harness', () => {
describe('integration: create project with harness', () => {
let project: TestProject;
const harnessName = 'CreateHarness';

Expand Down
13 changes: 5 additions & 8 deletions integ-tests/create-edge-cases.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ describe.skipIf(!prereqs.npm || !prereqs.git)('integration: create edge cases',
`Error should mention reserved/conflict: ${json.error}`
).toBeTruthy();

// No agent-path flags -> create defaults to the harness path.
telemetry.assertMetricEmitted({
command: 'create',
exit_reason: 'failure',
error_name: 'ValidationError',
error_source: 'user',
agent_environment: 'runtime',
agent_language: 'python',
agent_environment: 'harness',
has_agent: 'true',
});
});
Expand Down Expand Up @@ -141,12 +141,11 @@ describe.skipIf(!prereqs.npm || !prereqs.git)('integration: create edge cases',
expect(json.success).toBe(true);
expect(json.projectPath).toBeTruthy();

// No agent-path flags -> create defaults to the harness path.
telemetry.assertMetricEmitted({
command: 'create',
exit_reason: 'success',
agent_environment: 'runtime',
agent_language: 'python',
agent_framework: 'strands',
agent_environment: 'harness',
model_provider: 'bedrock',
has_agent: 'true',
});
Expand Down Expand Up @@ -197,9 +196,7 @@ describe.skipIf(!prereqs.npm || !prereqs.git)('integration: create edge cases',
});
});

const isPreviewBuild = process.env.BUILD_PREVIEW === '1';

describe.skipIf(!isPreviewBuild || !prereqs.npm || !prereqs.git)('integration: create harness project', () => {
describe.skipIf(!prereqs.npm || !prereqs.git)('integration: create harness project', () => {
let testDir: string;
const telemetry = createTelemetryHelper();

Expand Down
4 changes: 1 addition & 3 deletions integ-tests/dev-server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,7 @@ describe('integration: dev server', () => {
);
});

const isPreviewBuild = process.env.BUILD_PREVIEW === '1';

describe.skipIf(!isPreviewBuild || !hasNpm || !hasGit || !hasUv)('integration: dev with harness-only project', () => {
describe.skipIf(!hasNpm || !hasGit || !hasUv)('integration: dev with harness-only project', () => {
const telemetry = createTelemetryHelper();
let projectPath: string;

Expand Down
11 changes: 6 additions & 5 deletions integ-tests/json-output.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ describe('JSON output structure', () => {
).toBeTruthy();
});

it('missing required options returns error JSON', async () => {
// Missing --language, --framework, etc without --no-agent
it('bare create (no agent flags) returns harness success JSON', async () => {
// Without agent-path flags or --no-agent, create defaults to the harness path
// and succeeds rather than erroring on missing agent options.
const result = await runCLI(['create', '--name', 'ValidName', '--json'], testDir);

expect(result.exitCode).toBe(1);
expect(result.exitCode, `stdout: ${result.stdout}`).toBe(0);
const json = JSON.parse(result.stdout);
expect(json.success).toBe(false);
expect(typeof json.error).toBe('string');
expect(json.success).toBe(true);
expect(typeof json.projectPath).toBe('string');
});

it('invalid framework returns error JSON', async () => {
Expand Down
4 changes: 2 additions & 2 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"build:lib": "tsc -p tsconfig.build.json",
"build:cli": "node esbuild.config.mjs",
"build:assets": "node scripts/copy-assets.mjs",
"build:preview": "BUILD_PREVIEW=1 node esbuild.config.mjs",
"build:harness": "BUILD_HARNESS=1 node esbuild.config.mjs",
"cli": "npx tsx src/cli/index.ts",
"typecheck": "tsc --noEmit --incremental",
Expand Down
Loading
Loading