@bnbagent/studio-cli 0.0.6-alpha.5 → 0.0.6-alpha.7
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/dist/bag.js +665 -315
- package/package.json +3 -3
- package/recipes/agent/recipe.toml +1 -1
- package/recipes/runtimes/agentcore/recipe.toml +1 -1
- package/recipes/runtimes/azure-foundry/recipe.toml +1 -1
- package/recipes/x402-buyer/recipe.toml +1 -1
- package/skills/bnbagent-studio.md +1 -1
- package/skills/references/bnbagent-studio-adding-to-project.md +6 -6
- package/skills/references/bnbagent-studio-operating.md +1 -2
- package/skills/references/bnbagent-studio-scaffolding-agent.md +8 -9
- package/skills/references/bnbagent-studio-selling-via-8183.md +3 -4
- package/skills/references/bnbagent-studio-use-aws-agentcore.md +12 -14
- package/skills/references/bnbagent-studio-using-twak-wallet.md +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bnbagent/studio-cli",
|
|
3
|
-
"version": "0.0.6-alpha.
|
|
3
|
+
"version": "0.0.6-alpha.7",
|
|
4
4
|
"description": "The `bag` CLI: scaffold, run, deploy, and monetize a single seller agent on BNB Chain (ERC-8004 identity, ERC-8183 commerce, x402 payments).",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"bag": "./dist/bag.js"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@bnbagent/sdk": "0.5.0-alpha.
|
|
29
|
+
"@bnbagent/sdk": "0.5.0-alpha.3",
|
|
30
30
|
"ai": "^7.0.29",
|
|
31
31
|
"archiver": "^8.0.0",
|
|
32
32
|
"commander": "^15.0.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"tar": "^7.4.0",
|
|
39
39
|
"viem": "^2.54.0",
|
|
40
40
|
"yaml": "^2.9.0",
|
|
41
|
-
"@bnbagent/studio-runtime": "0.0.6-alpha.
|
|
41
|
+
"@bnbagent/studio-runtime": "0.0.6-alpha.7"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@a2a-js/sdk": "^0.3.14",
|
|
@@ -11,7 +11,7 @@ node = [
|
|
|
11
11
|
# neutral. The agent project's serving deps (@a2a-js/sdk / MCP SDK / ai)
|
|
12
12
|
# come from the runtimes/<R>/ recipe selected at `bag init` time.
|
|
13
13
|
"@bnbagent/studio-runtime",
|
|
14
|
-
"@bnbagent/sdk@0.5.0-alpha.
|
|
14
|
+
"@bnbagent/sdk@0.5.0-alpha.3",
|
|
15
15
|
]
|
|
16
16
|
|
|
17
17
|
[env]
|
|
@@ -32,7 +32,7 @@ node = [
|
|
|
32
32
|
# BNBAGENT_RUNTIME_SECRET_ID is set (default secretsmanager mode + platform).
|
|
33
33
|
"@aws-sdk/client-secrets-manager@^3.600.0",
|
|
34
34
|
"@bnbagent/studio-runtime",
|
|
35
|
-
"@bnbagent/sdk@0.5.0-alpha.
|
|
35
|
+
"@bnbagent/sdk@0.5.0-alpha.3",
|
|
36
36
|
# The LLM work hook (generateText + tools) and the model factory.
|
|
37
37
|
"ai@^7.0.29",
|
|
38
38
|
# Tool input schemas (AI SDK tools + MCP registerTool).
|
|
@@ -19,7 +19,7 @@ status = "v1"
|
|
|
19
19
|
[dependencies]
|
|
20
20
|
node = [
|
|
21
21
|
"@bnbagent/studio-runtime",
|
|
22
|
-
"@bnbagent/sdk@0.5.0-alpha.
|
|
22
|
+
"@bnbagent/sdk@0.5.0-alpha.3",
|
|
23
23
|
# The LLM work hook (generateText + tools) and the model factory; the
|
|
24
24
|
# Foundry host's OpenAI-compatible client comes from @ai-sdk/openai
|
|
25
25
|
# (built from the BNBAGENT_LLM_* env the deploy injects).
|
|
@@ -97,7 +97,7 @@ prices retain the paid merchant flow.
|
|
|
97
97
|
|
|
98
98
|
## CLI groups at a glance
|
|
99
99
|
|
|
100
|
-
`init`, `scan`, `recipe`, `skills`, `wallet`, `erc8004`, `erc8183`, `x402`, `agents`, `config`, `env`, `dev`, `doctor`, `audit`, `deploy`, `platform`, `llm`, `bundle`, `budget` — see `bag --help` for details. `bag deploy [--provider bnb\|aws]` is the primary deploy command; `prepare`, `verify`, `status`, `info`, `destroy`, `logs`, `fix-gitignore
|
|
100
|
+
`init`, `scan`, `recipe`, `skills`, `wallet`, `erc8004`, `erc8183`, `x402`, `agents`, `config`, `env`, `dev`, `doctor`, `audit`, `deploy`, `platform`, `llm`, `bundle`, `budget` — see `bag --help` for details. `bag deploy [--provider bnb\|aws]` is the primary deploy command; `prepare`, `verify`, `status`, `info`, `destroy`, `logs`, and `fix-gitignore` remain lifecycle subcommands (`deploy agent` is a deprecated compatibility alias). Provider deploy/status/logs/destroy and deploy-time credential validation are delegated to pinned `@bnbagent/deploy-cli@0.4.14`.
|
|
101
101
|
|
|
102
102
|
## Tool surface
|
|
103
103
|
|
|
@@ -189,16 +189,16 @@ ERC-8004/8183 **last** with the deployed AgentCore endpoint:
|
|
|
189
189
|
|
|
190
190
|
```bash
|
|
191
191
|
bag deploy prepare # readiness sweep
|
|
192
|
-
bag deploy provision-cognito # emits the Cognito CDK app you run (cdk deploy); wires discoveryUrl/clientId
|
|
193
192
|
bag deploy --provider aws # ship the Agent to AgentCore
|
|
194
193
|
bag deploy verify --provider aws # delegated status + reconcile ERC-8004 identity
|
|
195
194
|
```
|
|
196
195
|
|
|
197
|
-
Gotcha:
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
196
|
+
Gotcha: `bag deploy --provider aws` provisions the Cognito user pool and the
|
|
197
|
+
buyer M2M client itself and prints the token URL, client id, and scope — hand
|
|
198
|
+
those to each buyer (Cognito has no public M2M self-registration; retrieve the
|
|
199
|
+
client secret read-only from the AWS Console). Do not run
|
|
200
|
+
`bag deploy provision-cognito`: it is deprecated and its CDK pool is never used
|
|
201
|
+
by a deploy.
|
|
202
202
|
|
|
203
203
|
Gotcha: `dispute_window` is read from the on-chain policy contract (24h on
|
|
204
204
|
testnet). Buyers can dispute within that window after submit — the Agent can't
|
|
@@ -25,7 +25,7 @@ wallet/LLM/budget ops.
|
|
|
25
25
|
directory (Claude Code: `~/.claude/skills/bnbagent-studio/references/`; Cursor:
|
|
26
26
|
`bnbagent-studio/references/` beside the `.mdc` rules). READ
|
|
27
27
|
the file when the topic comes up — don't answer from memory:
|
|
28
|
-
- `bnbagent-studio-use-aws-agentcore.md` — the delegated AgentCore lifecycle (`bag deploy --provider aws` / `status` / `logs` / `verify` / `destroy
|
|
28
|
+
- `bnbagent-studio-use-aws-agentcore.md` — the delegated AgentCore lifecycle (`bag deploy --provider aws` / `status` / `logs` / `verify` / `destroy`) + AWS prerequisites
|
|
29
29
|
- `bnbagent-studio-use-bnb-trial.md` — GitHub device login, 48h eligibility, staging verification, and the delegated BNB trial lifecycle
|
|
30
30
|
- `bnbagent-studio-using-twak-wallet.md` — `[wallet].kind = "twak"` create / fund / SIWE-bind / container deploy / limitations
|
|
31
31
|
- `bnbagent-studio-extending-signing.md` — `PolicyViolation` / `X402PolicyError` diagnosis + extending the EIP-712 allowlist
|
|
@@ -136,7 +136,6 @@ Returns a rich table of checks across the `app/agent/` sub-project:
|
|
|
136
136
|
| Wallet tBNB balance | 0 tBNB | Faucet: testnet.bnbchain.org/faucet-smart |
|
|
137
137
|
| Wallet U balance | 0 U | Transfer from holder, or ask for sponsor U |
|
|
138
138
|
| 8004 registered | Not registered | Normally registered automatically at `bag deploy verify`. Manual: `bag erc8004 register --endpoint <url>` (only if you need an on-chain identity before deploy). WARN-only in `bag doctor` — it doesn't block local dev. |
|
|
139
|
-
| Cognito authorizer (W9) | External-buyer readiness: `agentcore.json` carries no `authorizerConfiguration` / protocol metadata has placeholder `OAUTH_*` values | WARN-only (does NOT block) — needed to serve **external** buyers, not to deploy. With no authorizer the runtime is IAM/SigV4 owner-only (never anonymous). To open it to buyers: `bag deploy provision-cognito` → `cdk deploy --outputs-file cdk-outputs.json` → `bag deploy provision-cognito --wire`. |
|
|
140
139
|
|
|
141
140
|
WARN-only items don't block; FAIL items do (exit 1).
|
|
142
141
|
|
|
@@ -490,10 +490,10 @@ Local dev (from workspace root <name>/):
|
|
|
490
490
|
# seller's skills). For MCP, use an MCP client.
|
|
491
491
|
|
|
492
492
|
When ready to deploy:
|
|
493
|
-
bag deploy provision-cognito # emit the Cognito CDK app — you run `cdk deploy`,
|
|
494
|
-
# then its discoveryUrl/clientId wire into the OAuth2 authorizer
|
|
495
493
|
bag deploy prepare # readiness sweep
|
|
496
494
|
bag deploy --provider aws # ship the Agent to AgentCore (selected faces);
|
|
495
|
+
# provisions the Cognito pool + buyer M2M client and
|
|
496
|
+
# prints the token URL / client id / scope;
|
|
497
497
|
# keystore injected via Secrets Manager (never in the CodeZip)
|
|
498
498
|
bag deploy verify --provider aws --endpoint <url> # delegated status + reconcile ERC-8004
|
|
499
499
|
|
|
@@ -529,13 +529,12 @@ Edit (from workspace root):
|
|
|
529
529
|
`TWAK_WALLET_PASSWORD` for twak — reconstructed at cold start, never in the
|
|
530
530
|
package; the testnet-only `--secrets-mode envvars` fallback is refused on
|
|
531
531
|
mainnet.
|
|
532
|
-
- **AgentCore seller endpoints are never anonymous.**
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
the scheme and is reachable without a token.
|
|
532
|
+
- **AgentCore seller endpoints are never anonymous.** `bag deploy --provider aws`
|
|
533
|
+
provisions the Cognito OAuth2 pool + buyer M2M client itself and prints the
|
|
534
|
+
token URL / client id / scope to hand to buyers (`bag deploy provision-cognito`
|
|
535
|
+
is deprecated — a deploy uses its own pool regardless). Locally, `bag dev` runs
|
|
536
|
+
without Cognito env, so the card omits the scheme and is reachable without a
|
|
537
|
+
token.
|
|
539
538
|
- **ERC-8183 does NOT require ERC-8004** at the protocol level (commerce contract
|
|
540
539
|
doesn't check the identity registry). Local two-agent dev can run end-to-end
|
|
541
540
|
without ever touching 8004. Use 8004 only when you actually want discoverable
|
|
@@ -160,12 +160,11 @@ Full Pieverse credit decisions live in `funding-pieverse-llm` (project-scope ski
|
|
|
160
160
|
|
|
161
161
|
ERC-8183 / ERC-8004 registration is a **deploy-time** concern: the public
|
|
162
162
|
AgentCore endpoint must exist before you register, so register **last**. The
|
|
163
|
-
agent endpoint has no anonymous mode
|
|
164
|
-
authorizer
|
|
163
|
+
agent endpoint has no anonymous mode; `bag deploy` provisions the Cognito
|
|
164
|
+
OAuth2 authorizer as part of the deploy.
|
|
165
165
|
|
|
166
166
|
```bash
|
|
167
167
|
bag deploy prepare # readiness sweep
|
|
168
|
-
bag deploy provision-cognito # emit the Cognito CDK app; run `cdk deploy`, wire discoveryUrl/clientId
|
|
169
168
|
bag deploy --provider aws # ship the agent to AgentCore (selected protocol)
|
|
170
169
|
bag deploy verify --provider aws # delegated status + reconcile ERC-8004 identity
|
|
171
170
|
```
|
|
@@ -178,7 +177,7 @@ asks bnbagent-deploy for live status first, then performs the reconcile.
|
|
|
178
177
|
|
|
179
178
|
**Hard rules**:
|
|
180
179
|
- The endpoint must be **reachable** when registered. For A2A, smoke test the normalized card URL directly, for example `curl <agentcore-invocations-url>/.well-known/agent-card.json` (or `curl <already-registered-card-url>` if the endpoint already includes `/.well-known/agent-card.json`). For MCP, connect an MCP client to the deployed `/mcp` URL. Chain doesn't verify reachability, but buyers will see failures.
|
|
181
|
-
-
|
|
180
|
+
- `bag deploy --provider aws` provisions the Cognito user pool + buyer M2M client and prints the token URL, client id, and scope. Hand those to each buyer (the client secret is retrieved read-only from the AWS Console — studio never stores it). `bag deploy provision-cognito` is deprecated; its CDK pool is never used by a deploy.
|
|
182
181
|
- Price bounds (`min_price`/`max_price`) live with the Agent — it clamps + signs the quote.
|
|
183
182
|
|
|
184
183
|
## Stage 5 — How a SUBMITTED job happens
|
|
@@ -106,7 +106,7 @@ flags); cloud execution is the pinned bnbagent-deploy's job.
|
|
|
106
106
|
| `bag deploy status [--provider aws]` | List every recorded deployment and delegated live state (read-only); `--no-probe` is local-only. |
|
|
107
107
|
| `bag deploy logs [--provider aws] [--follow] [--since 10m]` | Delegate runtime logs to bnbagent-deploy. |
|
|
108
108
|
| `bag deploy destroy [--provider aws]` | Dry-run teardown plan; `--execute` delegates `destroy --yes`; `--purge` also deletes retained ECR/log resources. |
|
|
109
|
-
| `bag deploy provision-cognito [--wire]` |
|
|
109
|
+
| `bag deploy provision-cognito [--wire]` | **Deprecated** (hidden from `--help`). Emits a Cognito CDK app whose pool a deploy never uses. |
|
|
110
110
|
|
|
111
111
|
## Typical workflows
|
|
112
112
|
|
|
@@ -129,21 +129,19 @@ plus a container engine.
|
|
|
129
129
|
> without asking the user first.
|
|
130
130
|
|
|
131
131
|
> 🔒 **Inbound auth is auto-provisioned.** An AgentCore seller endpoint is
|
|
132
|
-
> **never anonymous**.
|
|
133
|
-
>
|
|
134
|
-
>
|
|
135
|
-
>
|
|
132
|
+
> **never anonymous**. The delegated deploy provisions a Cognito inbound OAuth
|
|
133
|
+
> (account pool + per-agent M2M client) so the runtime is token-gated, then
|
|
134
|
+
> writes the live token URL, scope, client id, and discovery URL back into
|
|
135
|
+
> `studio.toml`, `agentcore.json`, and the printed buyer block. Hand those to
|
|
136
|
+
> each buyer; the client secret is retrieved read-only in the AWS Console
|
|
137
|
+
> (Cognito → User pools → App clients → "Show client secret") — never
|
|
138
|
+
> persisted by studio.
|
|
136
139
|
>
|
|
137
|
-
>
|
|
138
|
-
>
|
|
139
|
-
>
|
|
140
|
-
> 2. `bag deploy provision-cognito --wire` reads that local outputs file and
|
|
141
|
-
> patches `agentcore.json`'s `authorizerConfiguration.customJwtAuthorizer` +
|
|
142
|
-
> the card's `OAUTH_TOKEN_URL` / `OAUTH_SCOPE` (no AWS call). The client
|
|
143
|
-
> secret is retrieved read-only in the AWS Console (Cognito → User pools →
|
|
144
|
-
> App clients → "Show client secret") — never persisted by studio.
|
|
140
|
+
> `bag deploy provision-cognito` (the CDK path) is **deprecated**: a deploy
|
|
141
|
+
> provisions and uses its own pool regardless, so the CDK stack is a billable
|
|
142
|
+
> orphan and anything wired from it gets overwritten.
|
|
145
143
|
>
|
|
146
|
-
> Buyers
|
|
144
|
+
> Buyers reach the agent over plain HTTPS + an OAuth2 Bearer (the
|
|
147
145
|
> client-credentials grant) — **no AWS SigV4 / IAM credentials**. Locally,
|
|
148
146
|
> `bag dev` runs without Cognito env, so the card omits the scheme.
|
|
149
147
|
|
|
@@ -254,6 +254,9 @@ registers a `Container` runtime and `app/agent/Dockerfile` builds the image
|
|
|
254
254
|
| No wallet import | S-6 | Switching wallet kinds changes your address → re-run `bag 8004 register` (new on-chain identity). |
|
|
255
255
|
| Programmatic wallet creation forces password onto argv | S-8 | Bridged by `bag wallet twak-init` (you supply it via stdin / 0600 file / hidden prompt; studio forwards it on the child's argv because twak requires the flag); the manual twak commands remain a fallback. |
|
|
256
256
|
| CLI has no daily/monthly caps | — | Studio's policy layer (`[budget].max_per_day_usd`, host allowlist, per-request caps) is the spend authority for both wallet kinds. |
|
|
257
|
+
| `twak wallet balance --chain bsctestnet` rejects the chain | BUG-031 | Fails with `CHAIN_UNSUPPORTED` even though `wallet address` and `erc8183` accept `bsctestnet`. Use `bag wallet balance` (RPC-based, works on testnet), or raw RPC: `eth_getBalance` for tBNB and an `eth_call` of `balanceOf(address)` on the U token for token balance. |
|
|
258
|
+
| `twak tx <hash> --chain bsctestnet` rejects the chain | BUG-032 | Same chain-registry gap on the readback path: transactions twak itself just mined on `bsctestnet` cannot be inspected with `twak tx`. Use public RPC (`eth_getTransactionByHash` / `eth_getTransactionReceipt`) or BscScan testnet instead. |
|
|
259
|
+
| Raw `twak erc8183 create-job` has no expiry preflight | BUG-030 | An `--expires-at` inside the policy's dispute window is accepted, all four funding steps succeed, and only the final `submit` reverts `SubmissionTooLate()` (`0x15e5dd74`). Prefer the SDK path (`ERC8183Client` preflights this); if you must use the raw CLI, set `expires_at ≥ now + deadline + dispute_window` — on testnet's 24h window, `now + 172800` (48h) is a safe floor. |
|
|
257
260
|
|
|
258
261
|
## 7. Quick health checks
|
|
259
262
|
|