@bnbagent/studio-cli 0.0.6 → 0.0.8-alpha.1
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/LICENSE +201 -0
- package/README.md +269 -9
- package/dist/_agentcoreName-DZDWEYD3.js +0 -0
- package/dist/_twak-4XF4H5PL.js +0 -0
- package/dist/bag.js +96 -14
- package/dist/chunk-ODCZKKZJ.js +0 -0
- package/dist/chunk-RO726HJG.js +0 -0
- package/dist/chunk-U7IDQ3K5.js +0 -0
- package/dist/deployCli-VM5TYKQX.js +0 -0
- package/package.json +28 -13
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of tracking or otherwise improving the Work,
|
|
59
|
+
but excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Support. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or support.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of "Purpose" be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 BNB Chain Studio
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
200
|
+
implied. See the License for the specific language governing
|
|
201
|
+
permissions and limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,19 +1,279 @@
|
|
|
1
1
|
# @bnbagent/studio-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@bnbagent/studio-cli) [](https://nodejs.org/) [](https://www.apache.org/licenses/LICENSE-2.0)
|
|
4
|
+
|
|
5
|
+
Build and operate a TypeScript seller agent on BNB Chain by describing what you want in Claude Code or Cursor.
|
|
6
|
+
|
|
7
|
+
The bundled `/bnbagent-studio` skill is the primary interface. It turns your intent into a safe, reviewable workflow and drives the `bag` CLI for you. `bag` remains available as the executable interface for automation and for developers who prefer direct control.
|
|
8
|
+
|
|
9
|
+
> Studio is under active development and may introduce breaking changes. Start on BSC testnet with a wallet funded only for the task.
|
|
10
|
+
|
|
11
|
+
## What Studio builds
|
|
12
|
+
|
|
13
|
+
- **One valuable agent, one wallet, one signer.** The same runtime can serve A2A, MCP, and X402 faces without splitting custody across services.
|
|
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.
|
|
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
|
+
- **A project you own.** Studio generates ordinary TypeScript under `app/agent/`; edit, fork, or move that code whenever you want.
|
|
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.
|
|
19
|
+
|
|
20
|
+
## Start with the skill
|
|
21
|
+
|
|
22
|
+
### Requirements
|
|
23
|
+
|
|
24
|
+
- Node.js 22 or newer.
|
|
25
|
+
- Claude Code or Cursor.
|
|
26
|
+
- Corepack and pnpm 10 for the generated workspace.
|
|
27
|
+
- Bun 1.3 or newer when you deploy.
|
|
28
|
+
- Docker only for container paths such as a `twak` deployment. The AWS CLI is optional and is used only for a read-only AgentCore quota check.
|
|
29
|
+
|
|
30
|
+
### 1. Install Studio and its IDE skill
|
|
4
31
|
|
|
5
32
|
```bash
|
|
6
33
|
npm install --global @bnbagent/studio-cli
|
|
7
|
-
bag
|
|
34
|
+
bag skills install
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`bag skills install` detects Claude Code and Cursor, lets you choose user or project scope, and installs the `/bnbagent-studio` router plus its on-demand playbooks. For a scripted install, choose the target and scope explicitly:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
bag skills install --target both --scope user
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Reload the IDE after installation so it discovers the skill.
|
|
44
|
+
|
|
45
|
+
### 2. Tell the skill what you want to sell
|
|
46
|
+
|
|
47
|
+
Open Claude Code or Cursor in the directory where the project should be created, then start with a prompt such as:
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
/bnbagent-studio Create a BNB Chain seller agent named weatheragent.
|
|
51
|
+
Start on BSC testnet, explain the available choices, then build and run it.
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
You can be more specific:
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
/bnbagent-studio Create an agent named researchagent that sells cited research reports.
|
|
58
|
+
Use ERC-8183, expose A2A and MCP, use the default wallet and LLM, store
|
|
59
|
+
deliverables on IPFS, and prepare it for the 48-hour BNB testnet trial.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Continue in natural language after creation:
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
/bnbagent-studio Implement the report-generation work, then run the agent locally
|
|
66
|
+
and diagnose anything blocking a funded delivery.
|
|
67
|
+
|
|
68
|
+
/bnbagent-studio Check deployment readiness, explain every permission and cost,
|
|
69
|
+
then deploy after I approve the target.
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The skill asks for the decisions it needs in one round, shows its work as a todo list, and routes each stage to the relevant bundled playbook. You do not need to memorize the CLI.
|
|
73
|
+
|
|
74
|
+
### 3. Keep control of sensitive steps
|
|
75
|
+
|
|
76
|
+
The skill can prepare and run the workflow, but it leaves consequential decisions with you:
|
|
77
|
+
|
|
78
|
+
- approve each shell command in your IDE; do not grant a blanket `bag:*` permission because the CLI includes deploy and payment commands;
|
|
79
|
+
- enter wallet passwords through hidden prompts or `.studio/.env.local`, never in chat or command-line arguments;
|
|
80
|
+
- obtain testnet funds and decide how much value a wallet may hold;
|
|
81
|
+
- review cloud permissions, runtime-secret exposure, and possible costs before deployment;
|
|
82
|
+
- confirm on-chain transactions and buyer settlement actions.
|
|
83
|
+
|
|
84
|
+
## The choices are composable
|
|
85
|
+
|
|
86
|
+
Studio does not force every agent through one fixed path. The skill guides these independent choices and checks incompatible combinations before it changes the project.
|
|
87
|
+
|
|
88
|
+
| Dimension | Choices | What to know |
|
|
89
|
+
| --- | --- | --- |
|
|
90
|
+
| Network | `bsc-testnet`, `bsc-mainnet` | Start on testnet. The managed BNB trial always uses BSC testnet. |
|
|
91
|
+
| Wallet | `evm-local`, `twak`, `altana` | Local encrypted keystore, Trust Wallet Agent Kit custody, or a bounded Altana runtime session. |
|
|
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. |
|
|
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. |
|
|
97
|
+
|
|
98
|
+
### Wallet choices
|
|
99
|
+
|
|
100
|
+
| Wallet | Custody model | Packaging | Important limits |
|
|
101
|
+
| --- | --- | --- | --- |
|
|
102
|
+
| `evm-local` (default) | Encrypted keystore in workspace-root `.studio/wallets/` | Node code zip by default | Set `WALLET_PASSWORD` in the owner-only local env file. The keystore stays outside `app/agent/`. |
|
|
103
|
+
| `twak` | Self-custody wallet managed by Trust Wallet Agent Kit in a project-dedicated home | Container | Requires the supported TWAK CLI. Docker is required for the managed-platform image path. |
|
|
104
|
+
| `altana` | Local admin keystore grants a budget- and time-bounded runtime session | Node code zip | The runtime receives only the session. Pieverse SIWE activation and paid B402 selling are not supported; renew or revoke the session explicitly. |
|
|
105
|
+
|
|
106
|
+
For AWS, runtime material is injected into infrastructure in your own account. For the managed BNB trial, the runtime runs in the operator's cloud: `evm-local` and `twak` signing material is transmitted to its managed secret store. Use a fresh testnet-only wallet and never reuse it on mainnet. An Altana deployment sends only its bounded session; keep the budget and expiry tight.
|
|
107
|
+
|
|
108
|
+
## The end-to-end journey
|
|
109
|
+
|
|
110
|
+
The skill normally takes a new seller through six stages:
|
|
111
|
+
|
|
112
|
+
1. **Install and design.** It gathers the agent name, what it sells, network, wallet, LLM, rails, faces, storage, pricing, and deployment intent, then runs `bag init`.
|
|
113
|
+
2. **Create custody and activate the model.** It creates or adopts the selected wallet without putting a password on the command line, helps fund the testnet wallet, and activates or tests the LLM.
|
|
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
|
+
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
|
+
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.
|
|
118
|
+
|
|
119
|
+
## What gets generated
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
weatheragent/
|
|
123
|
+
├── package.json workspace marker
|
|
124
|
+
├── pnpm-workspace.yaml
|
|
125
|
+
├── AGENTS.md generated safety rules for coding agents
|
|
126
|
+
├── agentcore/
|
|
127
|
+
│ ├── agentcore.json deployment descriptor
|
|
128
|
+
│ └── aws-targets.json AWS account and region for self-deploy
|
|
129
|
+
├── .studio/
|
|
130
|
+
│ ├── .env.local gitignored secrets, mode 0600
|
|
131
|
+
│ └── wallets/ encrypted keystore outside deployable code
|
|
132
|
+
└── app/agent/
|
|
133
|
+
├── studio.toml network, wallet, LLM, policy, rails, faces
|
|
134
|
+
└── src/
|
|
135
|
+
├── sellerCore.ts the work your agent sells
|
|
136
|
+
├── signing.ts fixed quote, verification, and submission path
|
|
137
|
+
├── tools.ts read-only chain tools for the LLM
|
|
138
|
+
├── main.ts A2A/X402 entrypoint
|
|
139
|
+
├── mcpMain.ts MCP-only entrypoint
|
|
140
|
+
└── dualMain.ts combined A2A + MCP entrypoint
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
The generated agent depends on [`@bnbagent/studio-runtime`](https://www.npmjs.com/package/@bnbagent/studio-runtime), not on the CLI. Removing the global CLI does not remove or disable an already generated runtime.
|
|
144
|
+
|
|
145
|
+
## How a seller gets paid
|
|
146
|
+
|
|
147
|
+
### ERC-8183: negotiated work with escrow
|
|
148
|
+
|
|
149
|
+
ERC-8183 is the default rail for work that has a description, deliverables, quality standards, and a settlement decision.
|
|
150
|
+
|
|
151
|
+
1. A buyer calls `negotiate`. Fixed code clamps the configured list price and signs a quote; no LLM participates in pricing.
|
|
152
|
+
2. The buyer creates the on-chain job, registers it, sets a budget, and funds escrow.
|
|
153
|
+
3. The buyer sends `notify_funded` with the job ID.
|
|
154
|
+
4. The seller verifies the signed terms, assigned provider, status, budget, and funded state on-chain before doing paid work.
|
|
155
|
+
5. The LLM performs only the requested work. A2A acknowledges first and delivers in the background; MCP completes inside the tool call.
|
|
156
|
+
6. The seller stores the deliverable and submits its reference on-chain.
|
|
157
|
+
7. The buyer fetches the result and manually chooses approve, reject, or dispute. Studio never silently auto-settles a buyer's job.
|
|
158
|
+
|
|
159
|
+
`price = "0"` is an explicit FREE ERC-8183 job. It skips U-token escrow, but state-changing calls still need the configured gas or sponsored path.
|
|
160
|
+
|
|
161
|
+
### x402: pay per HTTP request
|
|
162
|
+
|
|
163
|
+
The X402 face exposes `/x402`. Its seller rail has two intentional modes:
|
|
164
|
+
|
|
165
|
+
- a positive `price_usd` returns a payment challenge and uses B402 to verify and settle before work starts;
|
|
166
|
+
- `price_usd = "0"` is anonymous FREE passthrough and bypasses B402 credentials, verification, settlement, and payment auditing.
|
|
167
|
+
|
|
168
|
+
Paid mode requires a complete per-agent B402 merchant setup and a supported `evm-local` or `twak` payout wallet. 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
|
+
|
|
170
|
+
## Service faces
|
|
171
|
+
|
|
172
|
+
| Face | Local surface | Commerce behavior |
|
|
173
|
+
| --- | --- | --- |
|
|
174
|
+
| A2A | agent card plus JSON-RPC on port `9000` | `negotiate` and background `notify_funded` delivery over ERC-8183. |
|
|
175
|
+
| MCP | Streamable HTTP at `http://localhost:8000/mcp` | The same seller operations, with funded delivery completed synchronously. |
|
|
176
|
+
| A2A + MCP | A2A-native process on port `9000`, with `/mcp` tunneled | Both faces share one seller core, wallet, and busy-state lifecycle. |
|
|
177
|
+
| X402 | `/x402` on the selected runtime entrypoint | One paid or explicitly FREE request; independent of ERC-8183 escrow. |
|
|
178
|
+
|
|
179
|
+
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
|
+
|
|
181
|
+
## Deployment targets
|
|
182
|
+
|
|
183
|
+
Run the readiness sweep before either target:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
bag deploy prepare
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### BNB Chain managed trial
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
bag platform login
|
|
193
|
+
bag platform credit
|
|
194
|
+
bag deploy --provider bnb
|
|
195
|
+
bag deploy verify --provider bnb
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
This is a 48-hour BSC testnet sandbox in the operator's cloud. The clock starts on the first successful deploy and redeploying does not reset it. Runtime and data are automatically reclaimed at expiry. Use a throwaway wallet, review the key-exposure notice, and destroy the deployment early if you are finished.
|
|
199
|
+
|
|
200
|
+
### Your own AWS AgentCore account
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
bag deploy --provider aws
|
|
204
|
+
bag deploy verify --provider aws
|
|
8
205
|
```
|
|
9
206
|
|
|
10
|
-
|
|
207
|
+
The delegated deploy validates your AWS identity, builds the agent, provisions runtime secrets and inbound Cognito OAuth, and records the live endpoint. You own the account, IAM permissions, retained resources, and charges. A default `evm-local` code-zip deploy does not need Docker; container paths do.
|
|
208
|
+
|
|
209
|
+
For both providers, `bag deploy verify` checks live provider status and then registers or updates the ERC-8004 endpoint. `bag erc8004 register --endpoint <url>` is the manual path when you intentionally need an identity before the normal post-deploy verification step. Altana cannot perform the generic registration signature; use the custody-specific admin flow and verify with `--skip-register`.
|
|
210
|
+
|
|
211
|
+
Useful lifecycle commands:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
bag deploy status
|
|
215
|
+
bag deploy logs --provider aws
|
|
216
|
+
bag deploy verify --provider aws
|
|
217
|
+
bag deploy destroy --provider aws # dry-run plan
|
|
218
|
+
bag deploy destroy --provider aws --execute
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
When multiple deployments exist, select the provider explicitly for logs, verification, and destruction.
|
|
222
|
+
|
|
223
|
+
## Fund a BSC testnet seller
|
|
224
|
+
|
|
225
|
+
ERC-8183 uses the 18-decimal testnet **U** token. tBNB pays fallback gas; it is not the escrow currency.
|
|
226
|
+
|
|
227
|
+
1. Run `bag wallet show` and copy the agent wallet address.
|
|
228
|
+
2. Claim ERC-8183 testnet U from <https://united-coin-u.github.io/u-faucet/>.
|
|
229
|
+
3. Claim tBNB from the [BNB Chain testnet faucet](https://testnet.bnbchain.org/faucet-smart).
|
|
230
|
+
4. Run `bag wallet balance --all` and `bag doctor` before testing paid work.
|
|
231
|
+
|
|
232
|
+
The ERC-8183 testnet U contract is `0xc70B8741B8B07A6d61E54fd4B20f22Fa648E5565`. Do not substitute the 6-decimal B402/x402 test token; it belongs to a different rail. Canonical ERC-8004 and testnet ERC-8183 calls may use the configured sponsored-gas path, but keep a little tBNB for unsupported methods, token approval, custom contracts, or relay fallback.
|
|
233
|
+
|
|
234
|
+
## Direct CLI reference
|
|
235
|
+
|
|
236
|
+
Use the CLI directly for automation, incident response, or when you already understand the lifecycle. The skill calls the same commands and remains the best source of context-sensitive guidance.
|
|
237
|
+
|
|
238
|
+
| Area | Commands |
|
|
239
|
+
| --- | --- |
|
|
240
|
+
| Skills | `skills install`, `skills list`, `skills uninstall` |
|
|
241
|
+
| Project | `init`, `scan`, `recipe`, `dev`, `doctor`, `bundle` |
|
|
242
|
+
| Configuration | `config`, `env`, `agents` |
|
|
243
|
+
| Wallet and policy | `wallet`, `wallet session`, `budget`, `audit` |
|
|
244
|
+
| Identity | `erc8004 register`, `show`, `resolve`, `update-endpoint`, `update-metadata` |
|
|
245
|
+
| Escrowed commerce | `erc8183 list`, `buy`, `status`, `submit`, `fetch`, `settle` |
|
|
246
|
+
| Instant payments | `x402 quote`, `buy`, `trust`, `sell init`, `sell status` |
|
|
247
|
+
| LLM | `llm activate`, `test`, `status`, `list-models`, `usage`, `topup`, `auto-renew` |
|
|
248
|
+
| Deployment | `deploy`, `deploy prepare`, `verify`, `status`, `info`, `logs`, `destroy` |
|
|
249
|
+
| Managed trial | `platform login`, `whoami`, `credit`, `agents`, `invoke-client`, `kill` |
|
|
250
|
+
|
|
251
|
+
Run `bag --help` and `bag <command> --help` for the executable reference. Run `bag scan` for a non-mutating project inspection and `bag doctor` for readiness diagnostics.
|
|
252
|
+
|
|
253
|
+
## Security model
|
|
254
|
+
|
|
255
|
+
- Keep `.studio/.env.local`, `.studio/wallets/`, TWAK custody files, and Altana admin material out of version control and chat.
|
|
256
|
+
- Keep wallet files at the workspace root, never under deployable `app/agent/`.
|
|
257
|
+
- Keep quote creation, funded-job verification, submission, and x402 settlement in fixed code.
|
|
258
|
+
- Give the LLM only read-only chain tools; do not add raw signing or arbitrary transaction tools.
|
|
259
|
+
- Treat x402 host, recipient, asset, network, amount, retry, and daily budget as policy boundaries.
|
|
260
|
+
- Change signing allowlists only after reviewing the exact domain, primary type, contract, and spend authority being added.
|
|
261
|
+
- Use `bag deploy`; bypassing it skips Studio's readiness, secret-handling, and deployment reconciliation.
|
|
262
|
+
|
|
263
|
+
## Package relationship
|
|
264
|
+
|
|
265
|
+
| Package | Role |
|
|
266
|
+
| --- | --- |
|
|
267
|
+
| `@bnbagent/studio-cli` | Development and operations layer: IDE skills, scaffolding, wallet setup, diagnostics, commerce commands, and deployment. |
|
|
268
|
+
| [`@bnbagent/studio-runtime`](https://www.npmjs.com/package/@bnbagent/studio-runtime) | Library imported by the generated agent: config, wallet providers, policy, audit, identity, commerce, payments, storage, LLM, and read-only tools. |
|
|
269
|
+
| `@bnbagent/sdk` | Lower-level BNB Chain protocol implementations consumed through the runtime. |
|
|
270
|
+
|
|
271
|
+
The CLI and runtime are versioned and released together.
|
|
272
|
+
|
|
273
|
+
## Disclaimer
|
|
11
274
|
|
|
12
|
-
|
|
275
|
+
Studio can create wallet material, sign blockchain transactions, spend tokens through configured commerce flows, and provision cloud resources. Blockchain transactions may be irreversible, and external contracts, RPC services, payment facilitators, model providers, storage providers, and cloud platforms may fail or change independently of this package.
|
|
13
276
|
|
|
14
|
-
|
|
15
|
-
2. Claim ERC-8183 testnet U at <https://united-coin-u.github.io/u-faucet/>.
|
|
16
|
-
3. Get a little tBNB for gas from the [BNB Chain testnet faucet](https://testnet.bnbchain.org/faucet-smart).
|
|
17
|
-
4. Run `bag doctor` to verify both balances before buying paid work.
|
|
277
|
+
You are responsible for protecting keys and credentials, reviewing every transaction and permission, limiting wallet funds and session budgets, evaluating buyer and seller counterparties, securing deployed infrastructure, and paying any resulting network or cloud costs. The managed BNB trial runs in the operator's cloud and receives the runtime material described in [Wallet choices](#wallet-choices); use it only with a testnet wallet or a tightly bounded session.
|
|
18
278
|
|
|
19
|
-
|
|
279
|
+
This package is licensed under Apache-2.0 and provided **as is**, without warranties or guarantees. The authors and contributors are not responsible for lost funds, compromised credentials, service interruptions, unexpected charges, or other damages arising from its use. Nothing in this package is financial, investment, legal, or tax advice.
|
|
File without changes
|
package/dist/_twak-4XF4H5PL.js
CHANGED
|
File without changes
|
package/dist/bag.js
CHANGED
|
@@ -6439,7 +6439,11 @@ import {
|
|
|
6439
6439
|
} from "@bnbagent/sdk/wallets";
|
|
6440
6440
|
import { auditedOp as auditedOp2 } from "@bnbagent/studio-runtime/audit";
|
|
6441
6441
|
import { loadStudioToml as loadStudioToml9 } from "@bnbagent/studio-runtime/config";
|
|
6442
|
-
import {
|
|
6442
|
+
import {
|
|
6443
|
+
BSC_TESTNET_FAUCET_URLS,
|
|
6444
|
+
getNetwork as getNetwork5,
|
|
6445
|
+
toRaw as toRaw2
|
|
6446
|
+
} from "@bnbagent/studio-runtime/networks";
|
|
6443
6447
|
import { writePrivate } from "@bnbagent/studio-runtime/secretWrite";
|
|
6444
6448
|
import {
|
|
6445
6449
|
ALTANA_NETWORK_BY_STUDIO,
|
|
@@ -6495,6 +6499,23 @@ function loadContext(projectRoot) {
|
|
|
6495
6499
|
address
|
|
6496
6500
|
};
|
|
6497
6501
|
}
|
|
6502
|
+
async function requireAltanaAdminGas(ctx) {
|
|
6503
|
+
let balance;
|
|
6504
|
+
try {
|
|
6505
|
+
balance = await readNativeBalanceRaw(ctx.address, ctx.networkName);
|
|
6506
|
+
} catch (error) {
|
|
6507
|
+
printErr(
|
|
6508
|
+
`warning: could not check Altana admin gas balance on ${ctx.networkName} (${error instanceof Error ? error.message : String(error)}); continuing and letting Altana return the authoritative result.`
|
|
6509
|
+
);
|
|
6510
|
+
return;
|
|
6511
|
+
}
|
|
6512
|
+
if (balance !== 0n) return;
|
|
6513
|
+
const symbol = ctx.networkName === "bsc-testnet" ? "tBNB" : "BNB";
|
|
6514
|
+
const funding = ctx.networkName === "bsc-testnet" ? ` Fund it and retry. Testnet faucets: ${BSC_TESTNET_FAUCET_URLS.join(", ")}` : " Fund it with BNB and retry.";
|
|
6515
|
+
throw new Error(
|
|
6516
|
+
`Altana admin wallet ${ctx.address} has 0 ${symbol} on ${ctx.networkName} and cannot pay gas for session administration.${funding}`
|
|
6517
|
+
);
|
|
6518
|
+
}
|
|
6498
6519
|
function requirePassword() {
|
|
6499
6520
|
const password = process.env[PASSWORD_ENV];
|
|
6500
6521
|
if (!password) {
|
|
@@ -6646,6 +6667,7 @@ async function cmdSessionGrant(opts) {
|
|
|
6646
6667
|
projectRoot
|
|
6647
6668
|
},
|
|
6648
6669
|
async () => {
|
|
6670
|
+
await requireAltanaAdminGas(ctx);
|
|
6649
6671
|
await admin2.approveQuoteSignatureChecker(
|
|
6650
6672
|
restored,
|
|
6651
6673
|
deployedAddresses(ctx.network.chainId).commerceProxy
|
|
@@ -6690,6 +6712,7 @@ async function cmdSessionGrant(opts) {
|
|
|
6690
6712
|
projectRoot
|
|
6691
6713
|
},
|
|
6692
6714
|
async (h) => {
|
|
6715
|
+
await requireAltanaAdminGas(ctx);
|
|
6693
6716
|
if (existing !== null) {
|
|
6694
6717
|
printErr(`Revoking existing Altana session ${existing.publicKey}\u2026`);
|
|
6695
6718
|
await admin.revokeSession(existing.publicKey);
|
|
@@ -6779,6 +6802,7 @@ async function cmdSessionRevoke(opts) {
|
|
|
6779
6802
|
projectRoot
|
|
6780
6803
|
},
|
|
6781
6804
|
async () => {
|
|
6805
|
+
await requireAltanaAdminGas(ctx);
|
|
6782
6806
|
await admin.revokeSession(envelope.publicKey);
|
|
6783
6807
|
}
|
|
6784
6808
|
);
|
|
@@ -6818,6 +6842,7 @@ async function cmdSessionX402Setup(opts) {
|
|
|
6818
6842
|
projectRoot
|
|
6819
6843
|
},
|
|
6820
6844
|
async () => {
|
|
6845
|
+
await requireAltanaAdminGas(ctx);
|
|
6821
6846
|
await admin.approveX402SignatureChecker(restored);
|
|
6822
6847
|
try {
|
|
6823
6848
|
await admin.setPermit2Allowance(
|
|
@@ -8013,6 +8038,12 @@ async function cmdInit(nameArg, opts) {
|
|
|
8013
8038
|
printErr(`error: ${target} already exists. Use --force to overwrite.`);
|
|
8014
8039
|
return 2;
|
|
8015
8040
|
}
|
|
8041
|
+
if (opts.destination === "platform" && opts.network === "bsc-mainnet") {
|
|
8042
|
+
printErr(
|
|
8043
|
+
"error: --destination platform cannot be combined with --network bsc-mainnet. The managed platform trial is testnet-only; use --destination self for mainnet, or select bsc-testnet."
|
|
8044
|
+
);
|
|
8045
|
+
return 2;
|
|
8046
|
+
}
|
|
8016
8047
|
let runtime = opts.runtime;
|
|
8017
8048
|
let network = opts.network;
|
|
8018
8049
|
let destination = opts.destination;
|
|
@@ -9205,10 +9236,10 @@ function readWalletAddress(studioToml) {
|
|
|
9205
9236
|
async function printFaucetHint(network, address) {
|
|
9206
9237
|
printOut("");
|
|
9207
9238
|
if (network === "bsc-testnet") {
|
|
9208
|
-
const { BSC_TESTNET_FAUCET_URLS:
|
|
9239
|
+
const { BSC_TESTNET_FAUCET_URLS: BSC_TESTNET_FAUCET_URLS5 } = await import("@bnbagent/studio-runtime/networks");
|
|
9209
9240
|
printOut(`Your testnet wallet address: ${address}`);
|
|
9210
9241
|
printOut("Fund it (free) from these faucets \u2014 paste the address above:");
|
|
9211
|
-
for (const url of
|
|
9242
|
+
for (const url of BSC_TESTNET_FAUCET_URLS5) {
|
|
9212
9243
|
printOut(` \xB7 ${url}`);
|
|
9213
9244
|
}
|
|
9214
9245
|
printOut("(Faucets are needed only for paid models / on-chain settle.");
|
|
@@ -10200,6 +10231,10 @@ function isDir4(p) {
|
|
|
10200
10231
|
}
|
|
10201
10232
|
|
|
10202
10233
|
// src/cli/_runtimeEnvKeys.ts
|
|
10234
|
+
var PAYMASTER_URL_ENV_KEYS = [
|
|
10235
|
+
"BNBAGENT_PAYMASTER_URL_BSC_MAINNET",
|
|
10236
|
+
"BNBAGENT_PAYMASTER_URL_BSC_TESTNET"
|
|
10237
|
+
];
|
|
10203
10238
|
function tableOf8(cfg, key) {
|
|
10204
10239
|
const v = cfg[key];
|
|
10205
10240
|
return v !== null && typeof v === "object" && !Array.isArray(v) ? v : {};
|
|
@@ -10236,6 +10271,9 @@ function runtimeEnvKeysCore(cfg, resolvable) {
|
|
|
10236
10271
|
if (resolvable("RPC_URL")) {
|
|
10237
10272
|
keys.push("RPC_URL");
|
|
10238
10273
|
}
|
|
10274
|
+
for (const key of PAYMASTER_URL_ENV_KEYS) {
|
|
10275
|
+
if (resolvable(key)) keys.push(key);
|
|
10276
|
+
}
|
|
10239
10277
|
if (commerceRails(cfg).erc8183) {
|
|
10240
10278
|
for (const key of ERC8183_ADDRESS_OVERRIDE_KEYS) {
|
|
10241
10279
|
if (resolvable(key)) keys.push(key);
|
|
@@ -11408,6 +11446,29 @@ function erc8183RailChecks(cfg, env = process.env) {
|
|
|
11408
11446
|
}
|
|
11409
11447
|
return out;
|
|
11410
11448
|
}
|
|
11449
|
+
function dockerUsesNode22OrNewer(source) {
|
|
11450
|
+
for (const line of source.split(/\r?\n/)) {
|
|
11451
|
+
const from = /^\s*FROM\s+(.+)$/i.exec(line);
|
|
11452
|
+
if (from === null) continue;
|
|
11453
|
+
const tokens = from[1].trim().split(/\s+/);
|
|
11454
|
+
if (tokens[0]?.startsWith("--platform=")) {
|
|
11455
|
+
tokens.shift();
|
|
11456
|
+
} else if (tokens[0] === "--platform") {
|
|
11457
|
+
tokens.splice(0, 2);
|
|
11458
|
+
}
|
|
11459
|
+
const image = tokens[0];
|
|
11460
|
+
if (!image || image.includes("${")) continue;
|
|
11461
|
+
const withoutDigest = image.split("@", 1)[0];
|
|
11462
|
+
const lastSegment = withoutDigest.slice(withoutDigest.lastIndexOf("/") + 1);
|
|
11463
|
+
const colon = lastSegment.lastIndexOf(":");
|
|
11464
|
+
if (colon <= 0 || lastSegment.slice(0, colon) !== "node") continue;
|
|
11465
|
+
const major = /^(\d+)(?:[.-]|$)/.exec(lastSegment.slice(colon + 1));
|
|
11466
|
+
if (major !== null && Number.parseInt(major[1], 10) >= 22) {
|
|
11467
|
+
return true;
|
|
11468
|
+
}
|
|
11469
|
+
}
|
|
11470
|
+
return false;
|
|
11471
|
+
}
|
|
11411
11472
|
function x402SellerRailChecks(agentRoot2, cfg, target) {
|
|
11412
11473
|
const payments = tableOf2(cfg, "payments");
|
|
11413
11474
|
const rawSeller = payments.x402_seller;
|
|
@@ -11524,11 +11585,11 @@ function x402SellerRailChecks(agentRoot2, cfg, target) {
|
|
|
11524
11585
|
const dockerfile = path25.join(agentRoot2, "Dockerfile");
|
|
11525
11586
|
if (rails.x402 && isFile11(dockerfile)) {
|
|
11526
11587
|
const source = fs26.readFileSync(dockerfile, "utf8");
|
|
11527
|
-
if (
|
|
11588
|
+
if (!dockerUsesNode22OrNewer(source)) {
|
|
11528
11589
|
out.push({
|
|
11529
11590
|
level: Level.WARNING,
|
|
11530
11591
|
name: "x402_node_version",
|
|
11531
|
-
message: "The x402/B402 seller requires Node 22, but this container Dockerfile
|
|
11592
|
+
message: "The x402/B402 seller requires Node >=22, but this container Dockerfile has no exact node image with a numeric major >=22.",
|
|
11532
11593
|
details: { dockerfile }
|
|
11533
11594
|
});
|
|
11534
11595
|
}
|
|
@@ -12974,7 +13035,7 @@ import {
|
|
|
12974
13035
|
findSubProjectRoot as findSubProjectRoot13,
|
|
12975
13036
|
loadStudioToml as loadStudioToml17
|
|
12976
13037
|
} from "@bnbagent/studio-runtime/config";
|
|
12977
|
-
import { BSC_TESTNET_FAUCET_URLS } from "@bnbagent/studio-runtime/networks";
|
|
13038
|
+
import { BSC_TESTNET_FAUCET_URLS as BSC_TESTNET_FAUCET_URLS2 } from "@bnbagent/studio-runtime/networks";
|
|
12978
13039
|
|
|
12979
13040
|
// src/cli/_deploy/checks/warning.ts
|
|
12980
13041
|
import * as crypto4 from "crypto";
|
|
@@ -13447,8 +13508,8 @@ var checkPlatformFundingHint = async (_root, _target) => [
|
|
|
13447
13508
|
{
|
|
13448
13509
|
level: Level.INFO,
|
|
13449
13510
|
name: "platform_funding_hint",
|
|
13450
|
-
message: `testnet trial \u2014 keep a little tBNB for gas and testnet $U for commerce. Faucets: ${
|
|
13451
|
-
details: { faucets: [...
|
|
13511
|
+
message: `testnet trial \u2014 keep a little tBNB for gas and testnet $U for commerce. Faucets: ${BSC_TESTNET_FAUCET_URLS2.join(" \xB7 ")}`,
|
|
13512
|
+
details: { faucets: [...BSC_TESTNET_FAUCET_URLS2] }
|
|
13452
13513
|
}
|
|
13453
13514
|
];
|
|
13454
13515
|
var criticalChecks = [
|
|
@@ -14428,7 +14489,7 @@ function walletWarning(root, secrets) {
|
|
|
14428
14489
|
const who2 = typeof address === "string" && address ? ` (wallet ${address})` : "";
|
|
14429
14490
|
warn(
|
|
14430
14491
|
`
|
|
14431
|
-
|
|
14492
|
+
[expected \xB7 bounded Altana session]
|
|
14432
14493
|
This project's bounded Altana session${who2} will be transmitted to the BNB Chain operator's Secrets Manager so the trial runtime can sign on testnet. The session is budget-limited, expiring, and revocable \u2014 the admin keystore and WALLET_PASSWORD never ship.
|
|
14433
14494
|
If the current budget or expiry is wider than you want an operator-held key to carry, stop and grant a tighter one first:
|
|
14434
14495
|
bag wallet session grant --force --budget-u <small> --expiry-days <short>
|
|
@@ -15070,6 +15131,15 @@ function agentNetworkDefault(root) {
|
|
|
15070
15131
|
}
|
|
15071
15132
|
return String(tableOf13(cfg, "network").default ?? "").toLowerCase();
|
|
15072
15133
|
}
|
|
15134
|
+
function rejectPlatformMainnet(root) {
|
|
15135
|
+
if (agentNetworkDefault(root) !== "bsc-mainnet") {
|
|
15136
|
+
return null;
|
|
15137
|
+
}
|
|
15138
|
+
printErr(
|
|
15139
|
+
"error: the BNB Chain managed platform is testnet-only, but [network].default is bsc-mainnet. Deploy to your own provider or change the project to bsc-testnet. --skip-prepare, --force, and --yes cannot bypass this boundary."
|
|
15140
|
+
);
|
|
15141
|
+
return 1;
|
|
15142
|
+
}
|
|
15073
15143
|
function agentDeployDestination(root) {
|
|
15074
15144
|
const cfg = loadAgentCfg2(root);
|
|
15075
15145
|
if (cfg === null) {
|
|
@@ -15483,6 +15553,10 @@ async function cmdDeploy(opts, deployArgs) {
|
|
|
15483
15553
|
const rc = applyProjectRoot(opts.projectRoot);
|
|
15484
15554
|
if (rc !== null) return rc;
|
|
15485
15555
|
const root = resolveProjectRoot2(opts.projectRoot);
|
|
15556
|
+
if (opts.provider === "bnb") {
|
|
15557
|
+
const networkGate = rejectPlatformMainnet(root);
|
|
15558
|
+
if (networkGate !== null) return networkGate;
|
|
15559
|
+
}
|
|
15486
15560
|
const deployments = discoverRecordedDeployments(root);
|
|
15487
15561
|
const unavailable = unavailableProvidersForProject(root);
|
|
15488
15562
|
const interactive = stdinIsTty();
|
|
@@ -15516,6 +15590,10 @@ async function cmdDeploy(opts, deployArgs) {
|
|
|
15516
15590
|
printErr("cancelled: no deployment was started.");
|
|
15517
15591
|
return selection.exitCode;
|
|
15518
15592
|
}
|
|
15593
|
+
if (selection.provider === "bnb") {
|
|
15594
|
+
const networkGate = rejectPlatformMainnet(root);
|
|
15595
|
+
if (networkGate !== null) return networkGate;
|
|
15596
|
+
}
|
|
15519
15597
|
if (!interactive && !opts.yes) {
|
|
15520
15598
|
printErr(
|
|
15521
15599
|
`error: non-interactive ${selection.operation} on ${selection.provider} requires --yes`
|
|
@@ -15587,6 +15665,10 @@ async function cmdAgent(opts, agentcoreArgs) {
|
|
|
15587
15665
|
const root = resolveProjectRoot2(opts.projectRoot);
|
|
15588
15666
|
const destination = opts.provider ? opts.provider === "bnb" ? "platform" : "self" : opts.to ?? opts.destination ?? agentDeployDestination(root);
|
|
15589
15667
|
const packagingDestination = opts.to ?? opts.destination ?? agentDeployDestination(root);
|
|
15668
|
+
if (destination === "platform") {
|
|
15669
|
+
const networkGate = rejectPlatformMainnet(root);
|
|
15670
|
+
if (networkGate !== null) return networkGate;
|
|
15671
|
+
}
|
|
15590
15672
|
const driftAgentRoot = findSubProjectRoot16("agent", root) ?? root;
|
|
15591
15673
|
const driftKind = deployWalletKind(driftAgentRoot);
|
|
15592
15674
|
rc = checkPackagingDrift(
|
|
@@ -16565,7 +16647,7 @@ import { pieverseKeyHash as pieverseKeyHash4 } from "@bnbagent/studio-runtime/ll
|
|
|
16565
16647
|
import {
|
|
16566
16648
|
BSC_MAINNET_MIN_BNB,
|
|
16567
16649
|
BSC_MAINNET_MIN_U,
|
|
16568
|
-
BSC_TESTNET_FAUCET_URLS as
|
|
16650
|
+
BSC_TESTNET_FAUCET_URLS as BSC_TESTNET_FAUCET_URLS3,
|
|
16569
16651
|
BSC_TESTNET_MIN_BNB,
|
|
16570
16652
|
BSC_TESTNET_MIN_U,
|
|
16571
16653
|
ERC8183_SUBMIT_GAS_RESERVE_BNB,
|
|
@@ -17555,7 +17637,7 @@ async function checkBalances(projectRoot, data, networkOverride) {
|
|
|
17555
17637
|
const isMainnet = name === "bsc-mainnet";
|
|
17556
17638
|
const minBnb = isTestnet ? BSC_TESTNET_MIN_BNB : isMainnet ? BSC_MAINNET_MIN_BNB : 0;
|
|
17557
17639
|
const minBnbWei = BigInt(Math.round(minBnb * 1e6)) * 10n ** 12n;
|
|
17558
|
-
const faucetHint = isTestnet ? ` \u2014 faucets: ${
|
|
17640
|
+
const faucetHint = isTestnet ? ` \u2014 faucets: ${BSC_TESTNET_FAUCET_URLS3.join(", ")}` : "";
|
|
17559
17641
|
const bnbRaw = await readNativeBalanceRaw(address, name);
|
|
17560
17642
|
const reserve = ERC8183_SUBMIT_GAS_RESERVE_BNB;
|
|
17561
17643
|
const reserveHint = ` (each on-chain action reserves \u2248 ${reserve} BNB worst-case)`;
|
|
@@ -17963,7 +18045,7 @@ import {
|
|
|
17963
18045
|
updateServiceEndpoint as updateServiceEndpoint2
|
|
17964
18046
|
} from "@bnbagent/studio-runtime/erc8004";
|
|
17965
18047
|
import {
|
|
17966
|
-
BSC_TESTNET_FAUCET_URLS as
|
|
18048
|
+
BSC_TESTNET_FAUCET_URLS as BSC_TESTNET_FAUCET_URLS4,
|
|
17967
18049
|
fromRaw as fromRaw4,
|
|
17968
18050
|
getNetwork as getNetwork10
|
|
17969
18051
|
} from "@bnbagent/studio-runtime/networks";
|
|
@@ -18127,7 +18209,7 @@ async function precheckRegisterGas(wallet, network) {
|
|
|
18127
18209
|
if (balance >= REGISTER_MIN_BNB) {
|
|
18128
18210
|
return null;
|
|
18129
18211
|
}
|
|
18130
|
-
const faucet =
|
|
18212
|
+
const faucet = BSC_TESTNET_FAUCET_URLS4[0];
|
|
18131
18213
|
return `ERC-8004 register needs gas to broadcast, but ${wallet.address} holds only ${balance} BNB on ${network} (need ~${REGISTER_MIN_BNB}). Fund a little tBNB and retry. Faucet: ${faucet}`;
|
|
18132
18214
|
}
|
|
18133
18215
|
function syncAgentRegistry(agentId, op) {
|
|
@@ -20760,7 +20842,7 @@ function buildProgram() {
|
|
|
20760
20842
|
return program;
|
|
20761
20843
|
}
|
|
20762
20844
|
function cliVersion() {
|
|
20763
|
-
return "0.0.
|
|
20845
|
+
return "0.0.8-alpha.1";
|
|
20764
20846
|
}
|
|
20765
20847
|
|
|
20766
20848
|
// src/cli/updateCheck.ts
|
package/dist/chunk-ODCZKKZJ.js
CHANGED
|
File without changes
|
package/dist/chunk-RO726HJG.js
CHANGED
|
File without changes
|
package/dist/chunk-U7IDQ3K5.js
CHANGED
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bnbagent/studio-cli",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.8-alpha.1",
|
|
4
|
+
"description": "Skills-first toolkit and bag CLI for BNB Chain seller agents: ERC-8004 identity, ERC-8183 escrowed commerce, and x402 payments.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"bnb-chain",
|
|
7
|
+
"bsc",
|
|
8
|
+
"agent",
|
|
9
|
+
"ai-agent",
|
|
10
|
+
"seller-agent",
|
|
11
|
+
"erc-8004",
|
|
12
|
+
"erc-8183",
|
|
13
|
+
"x402",
|
|
14
|
+
"a2a",
|
|
15
|
+
"mcp",
|
|
16
|
+
"web3",
|
|
17
|
+
"payments",
|
|
18
|
+
"cli",
|
|
19
|
+
"scaffold"
|
|
20
|
+
],
|
|
5
21
|
"license": "Apache-2.0",
|
|
6
22
|
"repository": {
|
|
7
23
|
"type": "git",
|
|
@@ -9,7 +25,6 @@
|
|
|
9
25
|
"directory": "packages/studio-cli"
|
|
10
26
|
},
|
|
11
27
|
"type": "module",
|
|
12
|
-
"packageManager": "pnpm@10.24.0",
|
|
13
28
|
"engines": {
|
|
14
29
|
"node": ">=22"
|
|
15
30
|
},
|
|
@@ -26,16 +41,8 @@
|
|
|
26
41
|
"bin": {
|
|
27
42
|
"bag": "./dist/bag.js"
|
|
28
43
|
},
|
|
29
|
-
"scripts": {
|
|
30
|
-
"build": "tsup",
|
|
31
|
-
"test": "vitest run",
|
|
32
|
-
"lint": "biome check src tests",
|
|
33
|
-
"typecheck": "tsc --noEmit",
|
|
34
|
-
"check": "pnpm typecheck && pnpm lint && pnpm test && pnpm build"
|
|
35
|
-
},
|
|
36
44
|
"dependencies": {
|
|
37
45
|
"@bnbagent/sdk": "0.5.0",
|
|
38
|
-
"@bnbagent/studio-runtime": "0.0.6",
|
|
39
46
|
"ai": "^7.0.29",
|
|
40
47
|
"archiver": "^8.0.0",
|
|
41
48
|
"commander": "^15.0.0",
|
|
@@ -46,7 +53,8 @@
|
|
|
46
53
|
"smol-toml": "^1.3.0",
|
|
47
54
|
"tar": "^7.4.0",
|
|
48
55
|
"viem": "^2.54.0",
|
|
49
|
-
"yaml": "^2.9.0"
|
|
56
|
+
"yaml": "^2.9.0",
|
|
57
|
+
"@bnbagent/studio-runtime": "0.0.8-alpha.1"
|
|
50
58
|
},
|
|
51
59
|
"devDependencies": {
|
|
52
60
|
"@a2a-js/sdk": "^0.3.14",
|
|
@@ -62,5 +70,12 @@
|
|
|
62
70
|
"typescript": "^5.5.0",
|
|
63
71
|
"vitest": "^2.0.0",
|
|
64
72
|
"zod": "^3.25.76"
|
|
73
|
+
},
|
|
74
|
+
"scripts": {
|
|
75
|
+
"build": "tsup",
|
|
76
|
+
"test": "vitest run",
|
|
77
|
+
"lint": "biome check src tests",
|
|
78
|
+
"typecheck": "tsc --noEmit",
|
|
79
|
+
"check": "pnpm typecheck && pnpm lint && pnpm test && pnpm build"
|
|
65
80
|
}
|
|
66
|
-
}
|
|
81
|
+
}
|