@bnbagent/studio-cli 0.0.6-alpha.1 → 0.0.6-alpha.3
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 +948 -190
- package/dist/{chunk-M3ODFCA7.js → chunk-A7NAGZHR.js} +94 -15
- package/dist/{deployCli-N6TPN6XA.js → deployCli-264UE6KB.js} +1 -1
- package/package.json +3 -3
- package/recipes/agent/code/{{PKG}}/signing.ts.tmpl +12 -1
- package/recipes/runtimes/agentcore/code/{{PKG}}/dualMain.ts.tmpl +6 -3
- package/recipes/runtimes/agentcore/code/{{PKG}}/main.ts.tmpl +6 -3
- package/recipes/runtimes/agentcore/code/{{PKG}}/mcpMain.ts.tmpl +7 -5
- package/recipes/runtimes/agentcore/code/{{PKG}}/sellerCore.ts.tmpl +3 -2
- package/skills/bnbagent-studio.md +21 -14
- package/skills/references/bnbagent-studio-adding-to-project.md +17 -1
- package/skills/references/bnbagent-studio-buying-via-8183.md +19 -3
- package/skills/references/bnbagent-studio-operating.md +21 -3
- package/skills/references/bnbagent-studio-scaffolding-agent.md +18 -3
- package/skills/references/bnbagent-studio-selling-via-8183.md +20 -0
- package/skills/references/bnbagent-studio-selling-via-b402.md +42 -18
- package/skills/references/bnbagent-studio-use-aws-agentcore.md +3 -2
- package/skills/references/bnbagent-studio-use-azure-foundry.md +1 -1
- package/skills/references/bnbagent-studio-use-bnb-trial.md +2 -2
- package/skills/references/bnbagent-studio-using-altana-wallet.md +5 -4
- package/skills/references/bnbagent-studio-using-twak-wallet.md +10 -8
|
@@ -106,6 +106,26 @@ quote_ttl_seconds = 300
|
|
|
106
106
|
default_estimated_completion_seconds = 600
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
+
An explicit `price = "0"` opts into free jobs when the selected ERC-8183
|
|
110
|
+
contract supports zero-price funding. Keep `currency` configured because it
|
|
111
|
+
remains part of the signed quote.
|
|
112
|
+
|
|
113
|
+
Prefer the CLI so the zero-price choice is visible and remains a decimal
|
|
114
|
+
string:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
bag config set payments.erc8183.price 0
|
|
118
|
+
bag env set ERC8183_COMMERCE_ADDRESS <commerce-address>
|
|
119
|
+
bag env set ERC8183_ROUTER_ADDRESS <router-address>
|
|
120
|
+
bag env set ERC8183_POLICY_ADDRESS <policy-address>
|
|
121
|
+
bag doctor
|
|
122
|
+
bag deploy prepare
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Take all three addresses from the same compatible custom deployment.
|
|
126
|
+
Doctor/prepare reject canonical or partial contract selection for FREE and
|
|
127
|
+
announce `zero token escrow` only when the complete custom stack is selected.
|
|
128
|
+
|
|
109
129
|
## Stage 3 — LLM credit continuity (Pieverse projects only)
|
|
110
130
|
|
|
111
131
|
If `[llm].provider = "pieverse-llm"`, the Agent's emitted
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: bnbagent-studio-selling-via-b402
|
|
3
|
-
description: When the user wants a bnbagent-studio agent to sell paid HTTP requests through the B402-backed x402 rail. Owns per-agent merchant onboarding, RSA key preparation, egress-IP allowlisting, sandbox/production separation, B402 environment setup, seller status checks, and activation by redeploy (managed platform or self-hosted AgentCore).
|
|
3
|
+
description: When the user wants a bnbagent-studio agent to sell paid or FREE HTTP requests through the B402-backed x402 rail. Owns the explicit pricing choice and, for PAID mode, per-agent merchant onboarding, RSA key preparation, egress-IP allowlisting, sandbox/production separation, B402 environment setup, seller status checks, and activation by redeploy (managed platform or self-hosted AgentCore).
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
> **Reference file** of the `bnbagent-studio` router skill — installed at
|
|
@@ -9,24 +9,46 @@ description: When the user wants a bnbagent-studio agent to sell paid HTTP reque
|
|
|
9
9
|
|
|
10
10
|
# Sell via B402
|
|
11
11
|
|
|
12
|
-
Use this playbook to activate the x402 seller rail for one agent.
|
|
13
|
-
credentials are per agent and per
|
|
14
|
-
|
|
12
|
+
Use this playbook to activate the x402 seller rail for one agent. First choose
|
|
13
|
+
PAID or FREE explicitly. B402 merchant credentials are per agent and per
|
|
14
|
+
environment and are needed only for PAID. Never reuse a merchant record across
|
|
15
|
+
agent wallets, or mix sandbox and production values.
|
|
15
16
|
|
|
16
17
|
## Preconditions
|
|
17
18
|
|
|
18
|
-
- The agent wallet already exists.
|
|
19
|
+
- The agent wallet already exists. In PAID mode its address receives U.
|
|
19
20
|
- The project targets the managed platform or self-hosted AgentCore
|
|
20
21
|
(azure-foundry cannot activate the rail).
|
|
21
|
-
-
|
|
22
|
+
- PAID managed platform only: a platform bearer token is available for reading the
|
|
22
23
|
platform egress IPs — the GitHub-login access token from
|
|
23
24
|
`bag platform login`, or a `bnbk_…` API token minted once by
|
|
24
25
|
`bag platform token`.
|
|
25
26
|
- `[payments.x402_seller]` exists. If not, run
|
|
26
27
|
`bag x402 sell init`.
|
|
27
28
|
|
|
28
|
-
The application uses the **agent wallet address**, not a developer
|
|
29
|
-
buyer wallet, or platform wallet.
|
|
29
|
+
The PAID application uses the **agent wallet address**, not a developer
|
|
30
|
+
treasury, buyer wallet, or platform wallet.
|
|
31
|
+
|
|
32
|
+
## Choose PAID or FREE
|
|
33
|
+
|
|
34
|
+
Use one of these explicit boundaries:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
bag init <name> --rails b402 --b402-price 0
|
|
38
|
+
bag x402 sell init --price-usd 0
|
|
39
|
+
bag config set payments.x402_seller.price_usd 0
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`"0"` means anonymous FREE passthrough. The runtime returns work directly and
|
|
43
|
+
does not issue a 402 challenge, call B402 `/supported`/verify/settle, transfer
|
|
44
|
+
U, or write an `x402_sell` settlement audit. B402 credentials are ignored and
|
|
45
|
+
not synchronized. Run `bag x402 sell status`, `bag doctor`, and
|
|
46
|
+
`bag deploy prepare`; all must label the route FREE.
|
|
47
|
+
|
|
48
|
+
This is unrestricted public access. Confirm that intent before continuing.
|
|
49
|
+
Managed platform still publishes the route through its gateway; self-hosted
|
|
50
|
+
AgentCore still needs an envelope-v1 front; Azure Foundry remains unsupported.
|
|
51
|
+
If FREE is the selected product, skip the merchant/RSA/IP sections below.
|
|
30
52
|
|
|
31
53
|
## Generate the agent's RSA material
|
|
32
54
|
|
|
@@ -130,7 +152,7 @@ Open the workspace `.studio/.env.local` in an editor and fill exactly four
|
|
|
130
152
|
values:
|
|
131
153
|
|
|
132
154
|
```dotenv
|
|
133
|
-
B402_BASE_URL=
|
|
155
|
+
B402_BASE_URL=https://qacb.sdtaop.com
|
|
134
156
|
B402_CLIENT_ID=
|
|
135
157
|
B402_ACCESS_TOKEN=
|
|
136
158
|
B402_PRIVATE_KEY_B64=
|
|
@@ -146,7 +168,7 @@ exactly one private-key form; do not set both.
|
|
|
146
168
|
|
|
147
169
|
## Verify and activate
|
|
148
170
|
|
|
149
|
-
|
|
171
|
+
For PAID mode, check names and presence without exposing values:
|
|
150
172
|
|
|
151
173
|
```bash
|
|
152
174
|
bag x402 sell status --no-probe
|
|
@@ -163,7 +185,7 @@ For a sandbox/trial agent, it must find exact/eip3009 U on `eip155:97`. For
|
|
|
163
185
|
production it must find the mainnet environment expected by the project. A
|
|
164
186
|
network mismatch is not safe to ignore.
|
|
165
187
|
|
|
166
|
-
Run the deployment gate, then redeploy to activate the
|
|
188
|
+
Run the deployment gate, then redeploy to activate the selected mode:
|
|
167
189
|
|
|
168
190
|
```bash
|
|
169
191
|
bag deploy prepare
|
|
@@ -171,11 +193,12 @@ bag deploy --provider bnb # managed platform
|
|
|
171
193
|
bag deploy --provider aws # self-hosted AgentCore
|
|
172
194
|
```
|
|
173
195
|
|
|
174
|
-
On the managed platform the deploy summary must say `x402 rail is ACTIVE`
|
|
175
|
-
print the anonymous `/x402` URL. On a self-hosted
|
|
176
|
-
`x402 rail is ACTIVE (self-hosted AgentCore)
|
|
177
|
-
|
|
178
|
-
|
|
196
|
+
On the managed platform the deploy summary must say `x402 rail is ACTIVE` (or
|
|
197
|
+
`ACTIVE in FREE mode`) and print the anonymous `/x402` URL. On a self-hosted
|
|
198
|
+
AgentCore deploy it says `x402 rail is ACTIVE (self-hosted AgentCore)` or
|
|
199
|
+
`ACTIVE in FREE mode (self-hosted AgentCore)`: the rail runs in-process, but
|
|
200
|
+
there is no anonymous URL — operate your own HTTP front that relays envelope-v1
|
|
201
|
+
JSON over SigV4-signed `InvokeAgentRuntime` calls (see
|
|
179
202
|
`docs/guides/x402-selling.md`, "Self-hosted AgentCore access"). A dormant or
|
|
180
203
|
forced-dormant summary means the rail was not activated; fix the named
|
|
181
204
|
credential, runtime, network, or tunnel condition and redeploy.
|
|
@@ -190,5 +213,6 @@ credential, runtime, network, or tunnel condition and redeploy.
|
|
|
190
213
|
does not trigger an automatic refund.
|
|
191
214
|
- The rail activates on AgentCore targets only (managed platform or
|
|
192
215
|
self-hosted); azure-foundry stays forced dormant.
|
|
193
|
-
-
|
|
194
|
-
|
|
216
|
+
- PAID payout wallets must use `wallet.kind` `evm-local` or `twak`; FREE has
|
|
217
|
+
no payout and does not apply this B402-specific allowlist.
|
|
218
|
+
- Never describe FREE as a zero-value B402 settlement. It bypasses B402.
|
|
@@ -197,8 +197,9 @@ bag deploy destroy --provider aws --execute # delegated teardown (add --purge)
|
|
|
197
197
|
## Reference
|
|
198
198
|
|
|
199
199
|
- b402/x402 selling on self-hosted AgentCore: the rail activates in-process
|
|
200
|
-
|
|
201
|
-
your own HTTP front that
|
|
200
|
+
with complete B402 credentials for PAID, or without them when explicit zero
|
|
201
|
+
selects FREE. There is no anonymous URL — operate your own HTTP front that
|
|
202
|
+
relays envelope-v1 over `InvokeAgentRuntime`. See
|
|
202
203
|
`bnbagent-studio-selling-via-b402` and `docs/guides/x402-selling.md`.
|
|
203
204
|
- `bag deploy --help` / `bag deploy <command> --help` (authoritative for commands + flags)
|
|
204
205
|
- `agentcore/agentcore.json` — name (resource naming continuity), protocol, authorizer, envVars
|
|
@@ -7,7 +7,7 @@ description: When the user wants to deploy or operate an A2A bnbagent-studio pro
|
|
|
7
7
|
|
|
8
8
|
# bnbagent-studio-use-azure-foundry
|
|
9
9
|
|
|
10
|
-
> **Preview.** Azure Foundry support is fully wired
|
|
10
|
+
> **Preview — not advertised in this release.** Azure Foundry support is fully wired but hidden from the `--runtime` menu and the deploy provider menu; these steps still work if you select `azure-foundry` / `--provider azure` explicitly. The most recent end-to-end live verification predates the TypeScript rewrite — treat your first deploy as a verification run.
|
|
11
11
|
|
|
12
12
|
Procedure for deploying and operating the seller Agent on **Azure AI
|
|
13
13
|
Foundry Hosted Agents** (`[stack].runtime = "azure-foundry"`). ALL cloud
|
|
@@ -13,7 +13,7 @@ keep `bsc-testnet`, and explain that the runtime signing material is transmitted
|
|
|
13
13
|
to the operator's managed secret store for the trial. Never use a mainnet key.
|
|
14
14
|
|
|
15
15
|
All auth and cloud lifecycle work must cross the pinned
|
|
16
|
-
`@bnbagent/deploy-cli@0.4.14` boundary. Do not call AWS
|
|
16
|
+
`@bnbagent/deploy-cli@0.4.14` boundary. Do not call the AWS CLI or platform
|
|
17
17
|
REST routes directly.
|
|
18
18
|
|
|
19
19
|
## Select and authenticate
|
|
@@ -35,7 +35,7 @@ Before offering BNB, inspect the trial result:
|
|
|
35
35
|
- `available`: selectable; explain that the 48h clock starts on first success.
|
|
36
36
|
- `active`: selectable; show remaining time and expiry immediately.
|
|
37
37
|
- `expired`: show the row and expiry, but mark it unavailable and do not select
|
|
38
|
-
it. AWS
|
|
38
|
+
it. AWS remains independently available when compatible with the
|
|
39
39
|
project scaffold.
|
|
40
40
|
- unknown/auth required: explain that eligibility cannot be confirmed until
|
|
41
41
|
login; the delegated deploy rechecks before building.
|
|
@@ -58,10 +58,11 @@ x402 buying remains separate and exact-bounded:
|
|
|
58
58
|
bag wallet session x402-setup --allowance-u <U> --yes
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
Altana cannot be the b402 **seller** payout wallet
|
|
62
|
-
`evm-local` and `twak` only); init, `bag x402 sell init`, and
|
|
63
|
-
readiness reject
|
|
64
|
-
is
|
|
61
|
+
Altana cannot be the b402 **seller** payout wallet for a positive price (paid
|
|
62
|
+
mode allows `evm-local` and `twak` only); init, `bag x402 sell init`, and
|
|
63
|
+
deploy readiness reject that paid combination. Explicit
|
|
64
|
+
`price_usd = "0"` is allowed because FREE passthrough performs no payout and
|
|
65
|
+
bypasses B402. The outbound buying authority above remains a separate feature.
|
|
65
66
|
|
|
66
67
|
For troubleshooting, run `bag doctor` and `bag wallet session status`. Do not
|
|
67
68
|
print, parse, or copy the `signer` portion of the serialized session, and never
|
|
@@ -173,11 +173,11 @@ Two assets, two different rules:
|
|
|
173
173
|
settles), so topping up burns no BNB. A twak wallet is also a supported
|
|
174
174
|
b402 **seller** payout wallet (`bag init --wallet-kind twak --rails b402`);
|
|
175
175
|
receiving needs no signature or gas either.
|
|
176
|
-
- **BNB (gas)** — **testnet
|
|
177
|
-
Testnet: the SDK forwards MegaFuel's
|
|
178
|
-
twak >= 0.20.0)
|
|
179
|
-
|
|
180
|
-
|
|
176
|
+
- **BNB (gas)** — **testnet canonical contracts normally use sponsorship;
|
|
177
|
+
mainnet needs a little for ERC-8183.** Testnet: the SDK forwards MegaFuel's
|
|
178
|
+
testnet paymaster (`--paymaster-url`, twak >= 0.20.0). Sponsorship still
|
|
179
|
+
depends on the paymaster policy covering the target contract and method;
|
|
180
|
+
keep a little tBNB (~0.007) as fallback. Mainnet: x402 stays gasless and `bag 8004
|
|
181
181
|
register` is gas-sponsored by twak internally (Trust gateway — studio
|
|
182
182
|
passes no paymaster flag), but **`8183 settle` / `fund` self-pay gas**, so
|
|
183
183
|
keep ~0.007 BNB on the wallet for them.
|
|
@@ -203,8 +203,8 @@ spending limit nothing can bypass. Studio's daily caps
|
|
|
203
203
|
(persisted to `.studio/spend-ledger.json`), best-effort in the deployed
|
|
204
204
|
runtime (in-memory, resets on cold start).
|
|
205
205
|
|
|
206
|
-
Testnet faucet: https://www.bnbchain.org/en/testnet-faucet (tBNB
|
|
207
|
-
Mainnet: U via PancakeSwap
|
|
206
|
+
Testnet faucet: https://www.bnbchain.org/en/testnet-faucet (tBNB fallback).
|
|
207
|
+
Mainnet: U via PancakeSwap; keep BNB for ERC-8183 fund/settle.
|
|
208
208
|
|
|
209
209
|
## 4. SIWE binding (Pieverse) — ALWAYS bind before paying
|
|
210
210
|
|
|
@@ -244,7 +244,9 @@ registers a `Container` runtime and `app/agent/Dockerfile` builds the image
|
|
|
244
244
|
|---|---|---|
|
|
245
245
|
| ~~Seller `submit` unavailable~~ | ~~REQ-1~~ RESOLVED in v0.19.0 | `submit --opt-params` works — verified on-chain. |
|
|
246
246
|
| ~~Seller `quote` signing broken~~ | ~~S-11 regression in v0.19.0~~ RESOLVED in v0.19.1 | v0.19.0 hex-decoded `0x…` messages and signed the bytes, so provider_sig never verified (testnet also rejected `sign-message --chain bsctestnet`). v0.19.1 signs the literal text (EIP-191): `sign_quote` works on both wallet kinds. |
|
|
247
|
-
| ~~
|
|
247
|
+
| ~~No testnet paymaster URL~~ | ~~REQ-2~~ RESOLVED in v0.20.0 | twak accepts `--paymaster-url`; the SDK forwards MegaFuel's testnet endpoint on eligible writes. Actual sponsorship depends on the paymaster policy covering the target and method (the relay itself is flaky — see the BUG-029 warning in §3). The CLI floor is **0.20.0**. |
|
|
248
|
+
| Custom ERC-8004 registry | supported | Set `ERC8004_REGISTRY_ADDRESS`; the SDK requires the intent target and env override to match before invoking twak. Sponsorship still depends on paymaster policy coverage, so keep fallback tBNB. |
|
|
249
|
+
| Custom ERC-8183 targets unavailable | upstream feature request | twak v0.20.0 has no Commerce/Router/Policy address option. Studio doctor/prepare and the SDK fail closed instead of silently executing on canonical contracts; use `evm-local` for a custom ERC-8183 deployment. |
|
|
248
250
|
| No generic EIP-712 signing | P0 (won't fix) | `[wallet.signing]` is ignored; payments go through the delegated payer's own prechecks + `--max-payment`. Endpoints needing an `Authorization` header *and* x402 are unavailable (e.g. `bag llm key new --initial-usd > 0` — use `--initial-usd 0` + topup + allocate instead, same end state). |
|
|
249
251
|
| No wallet import | S-6 | Switching wallet kinds changes your address → re-run `bag 8004 register` (new on-chain identity). |
|
|
250
252
|
| Programmatic wallet creation forces password onto argv | S-8 | Bridged by `bag wallet twak-init` (password via stdin / 0600 file / hidden prompt — never argv); the manual twak commands remain a fallback. |
|