Uh oh!
There was an error while loading. Please reload this page.
feat(project): add payment resources - #2120
Conversation
Claude Security Review: no high-confidence findings. (run) |
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Looks good
Nice work — the schema variants for manual vs. Quick Create are cleanly modeled, the L3 wiring in cdk-stack.ts narrows the union correctly, and the tests exercise the real filesystem instead of mocking fs (👍 per the harness guidance). A couple of small things to consider but nothing blocking:
src/assets/cdk/test/cdk.test.tsL7–L16:beforeAll/afterAlloperate onjoin(process.cwd(), 'agentcore'). ThemkdirSync(..., { recursive: true })won't fail if the directory already exists, andwriteFileSync(..., '{}')will overwrite any existingagentcore.json;afterAllthenrmSyncs the whole directory. If a developer ever runs this test from a real project root (or the vended CDK asset lands somewhere that already has anagentcore/), it would silently clobber real data. Consider usingmkdtempSync(orfs.mkdtempinos.tmpdir()) and pointing the L3 at it, similar to whatpayment-test-support.tsdoes. Non-blocking, but easy hardening.src/projectSchemas/project.tsL243–L258: the new credential env-var normalization check applies to all credential types, not just payment credentials. It's the right rule, but it's a project-wide validation change that could reject previously-accepted specs (e.g.service-key+service_key). Worth calling out in the PR description / release notes so it isn't a surprise on upgrade.src/projectSchemas/payment.tsL64–L69:defaultSpendLimit's refinement isNumber.isFinite(Number(value)) && Number(value) >= 0.Number("")andNumber(" ")both coerce to 0, so empty/whitespace strings slip through. A quickvalue.trim().length > 0 && ...would tighten it.
Telemetry: the sibling add handlers (gateway, api-key, oauth) don't instrument either, so the new payment handlers are consistent with existing patterns — no action needed here.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@## refactor #2120 +/- ##
============================================
+ Coverage 97.19% 97.23% +0.04%
============================================
Files 471 477 +6 Lines 28731 29334 +603 ============================================
+ Hits 27925 28523 +598 - Misses 806 811 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| paymentToolAllowlist?: string[]; | ||
| networkPreferences?: string[]; | ||
| connectors: { name: string; provider?: string; credentialName: string }[]; | ||
| connectors: { |
There was a problem hiding this comment.
This Schema change is already on main, but wasn't done in the fork.
Claude Security Review: no high-confidence findings. (run) |
Claude Security Review: no high-confidence findings. (run) |
Claude Security Review: no high-confidence findings. (run) |
Claude Security Review: no high-confidence findings. (run) |
Claude Security Review: no high-confidence findings. (run) |
Claude Security Review: no high-confidence findings. (run) |
Claude Security Review: no high-confidence findings. (run) |
Claude Security Review: no high-confidence findings. (run) |
| newSpec = { ...existingProjectSpec, [projectSpecKey]: newResources }; | ||
| } | ||
| if (!removed) |
There was a problem hiding this comment.
If we didn't remove anything, we should either throw an error and print it out in the console. This is OOS but wanted to bring this up.
Summary
Adds project-based Payments resource authoring:
Payment credentials are reusable project resources under
credentials[]. Createthe credential first, then reference it from a manual connector:
Quick Create is a connector-only mode and creates no
credentials[]entry:The change:
main;wallet-auth:prefixes;.env.local;@aws/agentcore-cdk@0.1.0-alpha.45to publishedalpha.49;Payment credential service-side provisioning remains outside these project
authoring commands. Manual connector deployment continues to consume credential
provider ARNs from target deployed state.
L3 Compatibility
Published L3
0.1.0-alpha.49contains Quick Create support fromaws/agentcore-l3-cdk-constructs#324, and
alpha.50preserves legacy generatedconnector props through aws/agentcore-l3-cdk-constructs#341.
aws/agentcore-l3-cdk-constructs#345 adds the
AgentCorePaymentsL3 sibling thatnow owns manager/connector construction, credential resolution, runtime wiring,
and outputs for newly generated projects. This PR includes the corresponding
generated-CDK cleanup, but its package manifest temporarily remains pinned to
alpha.49; generated-CDK build and deploy require the exact #345 tarball untilthat PR is merged, published, and pinned here.
Testing
Latest source verification on PR head
7adecd9c:bun test src: 2,227 passed;bun run typecheck,bun run format:check, andbun run lint:check.The included generated-CDK cleanup was tested independently with the exact
aws/agentcore-l3-cdk-constructs#345 tarball:
npm run build;npm test -- --runInBand: 3 passed;npm run format:check;and collision-safe construct identities.
Fresh refactor project
A project created by this branch's built CLI with the exact
aws/agentcore-l3-cdk-constructs#345 tarball:
0600.env.localand strippedthe documented
wallet-auth:prefix;a Coinbase Quick Create connector;
CREATE_COMPLETE; manual connectors reachedREADY,while Quick Create returned
PENDING_AUTHENTICATIONand an authorization URL;output identities;
absent.
Cross-version payment matrix
An old-CLI scaffold was populated exclusively through the new project commands,
then validated and deployed by released CLI
0.28.0.Verified:
READY;verified absent.
Scope
This PR does not add imperative Payments commands, TUI screens, or payment
credential deployment orchestration.