@bnbagent/studio-cli 0.0.13-alpha.2 → 0.0.13-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.
Files changed (25) hide show
  1. package/README.md +34 -6
  2. package/dist/bag.js +1571 -335
  3. package/dist/{chunk-XCKI45TP.js → chunk-E4C75NSV.js} +139 -43
  4. package/dist/{deployCli-HZNZU3CN.js → deployCli-UOUCOIW5.js} +1 -1
  5. package/package.json +4 -3
  6. package/recipes/agent/recipe.toml +1 -1
  7. package/recipes/mpp-buyer/code/{{PKG}}/mppBuyer.ts.tmpl +113 -0
  8. package/recipes/mpp-buyer/recipe.toml +15 -0
  9. package/recipes/runtimes/agentcore/code/{{PKG}}/dualMain.ts.tmpl +13 -12
  10. package/recipes/runtimes/agentcore/code/{{PKG}}/mcpMain.ts.tmpl +10 -9
  11. package/recipes/runtimes/agentcore/code/{{PKG}}/unifiedMain.ts.tmpl +16 -15
  12. package/recipes/runtimes/agentcore/recipe.toml +1 -1
  13. package/recipes/runtimes/azure-foundry/code/{{PKG}}/mcpMain.ts.tmpl +10 -9
  14. package/recipes/runtimes/azure-foundry/code/{{PKG}}/unifiedMain.ts.tmpl +16 -15
  15. package/recipes/runtimes/azure-foundry/recipe.toml +1 -1
  16. package/recipes/x402-buyer/recipe.toml +1 -1
  17. package/skills/bnbagent-studio.md +5 -4
  18. package/skills/references/bnbagent-studio-buying-via-8183.md +2 -2
  19. package/skills/references/bnbagent-studio-buying-via-mpp.md +44 -0
  20. package/skills/references/bnbagent-studio-scaffolding-agent.md +9 -5
  21. package/skills/references/bnbagent-studio-selling-via-8183.md +1 -1
  22. package/skills/references/bnbagent-studio-selling-via-b402.md +1 -1
  23. package/skills/references/bnbagent-studio-use-aws-agentcore.md +1 -1
  24. package/skills/references/bnbagent-studio-use-azure-foundry.md +44 -14
  25. package/skills/references/bnbagent-studio-use-bnb-trial.md +10 -3
package/README.md CHANGED
@@ -10,9 +10,9 @@ The bundled `/bnbagent-studio` skill is the primary interface. It turns your int
10
10
 
11
11
  ## What Studio builds
12
12
 
13
- - **One valuable agent, one wallet, one signer.** The same runtime can serve A2A, MCP, and X402 faces without splitting custody across services.
13
+ - **One valuable agent, one wallet, one signer.** The same runtime can serve A2A, MCP, and one B402 payment face (X402 or MPP) without splitting custody across services.
14
14
  - **On-chain identity.** ERC-8004 makes the deployed agent discoverable and records its live service endpoint.
15
- - **Two ways to earn.** ERC-8183 handles negotiated, escrowed jobs; x402 handles instant HTTP requests, with B402 settlement in paid mode.
15
+ - **Two ways to earn.** ERC-8183 handles negotiated, escrowed jobs; x402 or MPP handles instant HTTP requests, with B402 settlement in paid mode.
16
16
  - **Bounded signing.** Quotes and payment checks run in fixed code. Raw signing is never exposed to the LLM, whose chain tools are read-only.
17
17
  - **A project you own.** Studio generates ordinary TypeScript under `app/agent/`; edit, fork, or move that code whenever you want.
18
18
  - **A guided path to production.** Run locally, diagnose readiness, deploy to the managed BSC testnet trial or your own AWS AgentCore account, then register the public endpoint.
@@ -90,10 +90,10 @@ Studio does not force every agent through one fixed path. The skill guides these
90
90
  | Network | `bsc-testnet`, `bsc-mainnet` | Start on testnet. The managed BNB trial always uses BSC testnet. |
91
91
  | Wallet | `evm-local`, `twak`, `altana` | Local encrypted keystore, Trust Wallet Agent Kit custody, or a bounded Altana runtime session. |
92
92
  | LLM | Pieverse, OpenRouter, OpenAI, Anthropic, Bedrock | Pieverse is the default; `auto/free` starts at $0/token. Other providers use your own credentials. |
93
- | Commerce rails | ERC-8183, B402, or both | ERC-8183 is job escrow. B402 settles x402 requests. Rails and public faces are separate choices. |
94
- | Public faces | A2A, MCP, X402, or a combination | One seller core and one wallet serve every selected face. |
93
+ | Commerce rails | ERC-8183, B402, or both | ERC-8183 is job escrow. B402 settles request payments. Rails and public faces are separate choices. |
94
+ | Public faces | A2A, MCP, and either X402 or MPP | X402 and MPP are alternative adapters for the same B402 seller and cannot be selected together. |
95
95
  | Deployment | BNB managed trial or AWS AgentCore | Every deploy asks for `bnb` or `aws`; a previous deployment is never a silent default. |
96
- | Deliverable storage | local or IPFS | Local storage is for offline development and fails deployment readiness. IPFS is durable, public, and deploy-ready. |
96
+ | Deliverable storage | local, IPFS, S3, Azure Blob | Self-hosted deploys are BYOS: use IPFS, S3, or Azure Blob with a stable public read URL. Platform deploys ignore the project's local/BYOS choice; the API injects an agent-scoped token and uses managed S3 on AWS or Azure Blob on Azure. Public deliverable URLs stay on `bnbagent-api` and return 404 after the Agent is deleted. |
97
97
 
98
98
  ### Wallet choices
99
99
 
@@ -114,7 +114,7 @@ The skill normally takes a new seller through six stages:
114
114
  3. **Implement the value.** You edit the generated `runWork` hook in `app/agent/src/sellerCore.ts`. Pricing and signing stay in deterministic code.
115
115
  4. **Run and diagnose.** `bag doctor` checks the project, wallet, balances, LLM, network, and local runtime; `bag dev` starts the selected faces. Before deployment, `bag deploy prepare` adds storage, provider, and deploy-tooling gates.
116
116
  5. **Deploy and publish identity.** `bag deploy prepare` gates readiness, `bag deploy --provider ...` ships the runtime, and `bag deploy verify --provider ...` reconciles its ERC-8004 identity with the live endpoint.
117
- 6. **Earn and settle.** Buyers fund ERC-8183 jobs or pay an x402 request. The agent verifies payment before work, submits the result, and records an audit trail.
117
+ 6. **Earn and settle.** Buyers fund ERC-8183 jobs or pay an x402/MPP request. The agent verifies payment before work, submits the result, and records an audit trail.
118
118
 
119
119
  ## What gets generated
120
120
 
@@ -167,6 +167,21 @@ The X402 face exposes `/x402`. Its seller rail has two intentional modes:
167
167
 
168
168
  Paid mode requires a complete per-agent B402 merchant setup; any supported wallet kind can be the payout wallet (for altana the payout lands at the admin address). Payment settles before work; if later work fails, there is no automatic refund. On self-hosted AWS AgentCore the rail runs in-process, but a buyer-facing x402 URL requires your own gateway that authenticates its relay call to AgentCore and, for paid mode, a fixed-egress path to B402.
169
169
 
170
+ ### MPP+B402: the alternative request-payment protocol
171
+
172
+ Use `bag init <name> --rails b402 --payment-protocol mpp`. The generated project selects the `MPP` face, mounts `/mpp`, and uses the canonical `[payments.b402_seller]` policy. It emits only MPP—not x402—deployment publication metadata. Paid MPP additionally requires a 32-byte-or-longer `MPP_SECRET_KEY`, a stable `MPP_REALM`, and a durable atomic replay store shared by all production instances. See [the MPP+B402 guide](../../docs/guides/mpp-b402-selling.md).
173
+
174
+ MPP buyer commands mirror the x402 workflow while remaining protocol-explicit:
175
+
176
+ ```bash
177
+ bag mpp trust https://seller.example/mpp --yes
178
+ bag mpp quote https://seller.example/mpp
179
+ bag mpp buy https://seller.example/mpp --max-usd 0.10
180
+ bag recipe code mpp-buyer
181
+ ```
182
+
183
+ The buyer requires `evm-local` EIP-712 signing in P0, accepts B402 EIP-3009 only, pins realm plus recipient before signing, and never falls back to x402. Unknown post-dispatch outcomes are audited and never retried automatically. The emitted recipe is shared by AgentCore and Azure Foundry runtimes; managed Azure seller publication additionally depends on the platform's `mpp` capability.
184
+
170
185
  ## Service faces
171
186
 
172
187
  | Face | Local surface | Commerce behavior |
@@ -175,6 +190,7 @@ Paid mode requires a complete per-agent B402 merchant setup; any supported walle
175
190
  | MCP | Streamable HTTP at `http://localhost:8000/mcp` | The same seller operations, with funded delivery completed synchronously. |
176
191
  | A2A + MCP | A2A-native process on port `9000`, with `/mcp` tunneled | Both faces share one seller core, wallet, and busy-state lifecycle. |
177
192
  | X402 | `/x402` on the selected runtime entrypoint | One paid or explicitly FREE request; independent of ERC-8183 escrow. |
193
+ | MPP | `/mpp` on the selected runtime entrypoint | Alternative to X402; standard MPP challenge/credential/receipt headers with B402 settlement. |
178
194
 
179
195
  For an A2A project, inspect the local agent card at <http://localhost:9000/.well-known/agent-card.json>. A seller expects structured A2A data parts, so a plain-text chat box is not a complete commerce test.
180
196
 
@@ -186,6 +202,18 @@ Run the readiness sweep before either target:
186
202
  bag deploy prepare
187
203
  ```
188
204
 
205
+ To validate the exact managed backend explicitly (including Azure projects
206
+ whose scaffold intent remains self-hosted), select the same provider/backend
207
+ you will deploy:
208
+
209
+ ```bash
210
+ bag deploy prepare --provider bnb --backend aws
211
+ bag deploy prepare --provider bnb --backend azure
212
+ ```
213
+
214
+ These Platform targets use managed deliverable storage, so a project-local
215
+ `[storage].kind = "local"` does not trigger a BYOS storage blocker.
216
+
189
217
  ### BNB Chain managed trial
190
218
 
191
219
  ```bash