@bnbagent/studio-cli 0.0.13-alpha.4 → 0.0.13-alpha.5

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/README.md CHANGED
@@ -253,7 +253,7 @@ When multiple deployments exist, select the provider explicitly for logs, verifi
253
253
  ERC-8183 uses the 18-decimal testnet **U** token. tBNB pays fallback gas; it is not the escrow currency.
254
254
 
255
255
  1. Run `bag wallet show` and copy the agent wallet address.
256
- 2. Claim ERC-8183 testnet U from <https://united-coin-u.github.io/u-faucet/>.
256
+ 2. Claim ERC-8183 testnet U by messaging the official Telegram bot <https://t.me/bnbchain_official_bot> — send `I would like to get U to my wallet <address>`. More options: <https://united-coin-u.github.io/u-faucet/>.
257
257
  3. Claim tBNB by messaging the official Telegram bot <https://t.me/bnbchain_official_bot> — send `I would like to get tBNB to my wallet <address>` (up to 0.3 tBNB/day). More options: <https://docs.bnbchain.org/bnb-smart-chain/developers/faucet/>.
258
258
  4. Run `bag wallet balance --all` and `bag doctor` before testing paid work.
259
259
 
package/dist/bag.js CHANGED
@@ -55,7 +55,7 @@ import {
55
55
  x402SellerIsFree,
56
56
  x402SellerPricingState,
57
57
  x402SellerUsesB402
58
- } from "./chunk-OFAD65VZ.js";
58
+ } from "./chunk-BCUJGB4Y.js";
59
59
  import {
60
60
  TWAK_CLI_MIN_VERSION,
61
61
  TWAK_CLI_VERSION,
@@ -233,7 +233,7 @@ import {
233
233
  var CAMPAIGN_DOC_URL = "https://www.bnbchain.org/en/blog/bnb-agent-studio-is-live-on-bnb-chain-ai-agents-from-one-prompt";
234
234
  var CAMPAIGN_CHECK_TIMEOUT_MS = 6e3;
235
235
  async function fetchCampaignActive() {
236
- const { bnbPlatformApiUrl: bnbPlatformApiUrl2 } = await import("./deployCli-NZAZDPKK.js");
236
+ const { bnbPlatformApiUrl: bnbPlatformApiUrl2 } = await import("./deployCli-2YVGILHK.js");
237
237
  const controller = new AbortController();
238
238
  const timer = setTimeout(() => controller.abort(), CAMPAIGN_CHECK_TIMEOUT_MS);
239
239
  try {
@@ -3420,7 +3420,11 @@ function relocateKeys(src, target, label) {
3420
3420
  import * as fs23 from "fs";
3421
3421
  import * as os4 from "os";
3422
3422
  import * as path22 from "path";
3423
- import { getNetwork as getNetwork6 } from "@bnbagent/studio-runtime/networks";
3423
+ import {
3424
+ getNetwork as getNetwork6,
3425
+ tbnbFaucetHint as tbnbFaucetHint3,
3426
+ uFaucetHint as uFaucetHint3
3427
+ } from "@bnbagent/studio-runtime/networks";
3424
3428
  import { ensureTwakKeychain } from "@bnbagent/studio-runtime/wallet";
3425
3429
  import { Option as Option2 } from "commander";
3426
3430
  import { parse as parseToml } from "smol-toml";
@@ -4996,9 +5000,9 @@ import { generateText } from "ai";
4996
5000
 
4997
5001
  // src/cli/_pieverseHelpers.ts
4998
5002
  import {
4999
- BSC_TESTNET_U_FAUCET_URL,
5000
5003
  fromRaw as fromRaw2,
5001
- getNetwork as getNetwork3
5004
+ getNetwork as getNetwork3,
5005
+ uFaucetHint
5002
5006
  } from "@bnbagent/studio-runtime/networks";
5003
5007
  import {
5004
5008
  siweLogin
@@ -5052,7 +5056,7 @@ function printUBalanceShortfall(walletAddress, currentRaw, neededRaw, neededUsd,
5052
5056
  ` swap on PancakeSwap: https://pancakeswap.finance/swap?outputCurrency=${u.address}`
5053
5057
  );
5054
5058
  } else {
5055
- printErr(` testnet U faucet: ${BSC_TESTNET_U_FAUCET_URL}`);
5059
+ printErr(` testnet U faucet: ${uFaucetHint(walletAddress)}`);
5056
5060
  }
5057
5061
  }
5058
5062
  function writeEnvLocal(key, value, envPath = ".env.local") {
@@ -6836,7 +6840,7 @@ import {
6836
6840
  findProjectRoot as findProjectRoot3,
6837
6841
  loadStudioToml as loadStudioToml10
6838
6842
  } from "@bnbagent/studio-runtime/config";
6839
- import { tbnbFaucetHint as tbnbFaucetHint2 } from "@bnbagent/studio-runtime/networks";
6843
+ import { tbnbFaucetHint as tbnbFaucetHint2, uFaucetHint as uFaucetHint2 } from "@bnbagent/studio-runtime/networks";
6840
6844
  import { buildPolicy, buildWallet } from "@bnbagent/studio-runtime/wallet";
6841
6845
  import { getAddress as toChecksumAddress } from "viem";
6842
6846
 
@@ -7433,7 +7437,9 @@ function projectNetwork(projectRoot) {
7433
7437
  }
7434
7438
  function printNextAfterNew(projectRoot, address) {
7435
7439
  const network = projectNetwork(projectRoot);
7436
- const fund = network === "bsc-testnet" ? `fund it (free, only needed for paid models / on-chain settle): ${tbnbFaucetHint2(address)}` : "fund it with BNB (gas) + U before selling paid work";
7440
+ const fund = network === "bsc-testnet" ? `fund it (free, only needed for paid models / on-chain settle):
7441
+ tBNB: ${tbnbFaucetHint2(address)}
7442
+ U: ${uFaucetHint2(address)}` : "fund it with BNB (gas) + U before selling paid work";
7437
7443
  printErr(
7438
7444
  `Next: ${fund}
7439
7445
  then \`bag doctor\` to verify the project, \`bag dev\` to run it locally.`
@@ -9980,8 +9986,9 @@ async function printFaucetHint(network, address) {
9980
9986
  if (network === "bsc-testnet") {
9981
9987
  const {
9982
9988
  BSC_TESTNET_TBNB_TELEGRAM_FAUCET: BSC_TESTNET_TBNB_TELEGRAM_FAUCET2,
9989
+ BSC_TESTNET_U_TELEGRAM_FAUCET,
9983
9990
  BSC_TESTNET_FAUCET_DOCS_URL: BSC_TESTNET_FAUCET_DOCS_URL2,
9984
- BSC_TESTNET_U_FAUCET_URL: BSC_TESTNET_U_FAUCET_URL4
9991
+ BSC_TESTNET_U_FAUCET_URL: BSC_TESTNET_U_FAUCET_URL2
9985
9992
  } = await import("@bnbagent/studio-runtime/networks");
9986
9993
  printOut(`Your testnet wallet address: ${address}`);
9987
9994
  printOut("Fund it (free):");
@@ -9993,7 +10000,11 @@ async function printFaucetHint(network, address) {
9993
10000
  );
9994
10001
  printOut(" (up to 0.3 tBNB per day; it replies with the tx hash)");
9995
10002
  printOut(` more ways to get tBNB: ${BSC_TESTNET_FAUCET_DOCS_URL2}`);
9996
- printOut(` $U \u2014 ${BSC_TESTNET_U_FAUCET_URL4}`);
10003
+ printOut(
10004
+ ` $U \u2014 message the official Telegram bot ${BSC_TESTNET_U_TELEGRAM_FAUCET}`
10005
+ );
10006
+ printOut(` send: "I would like to get U to my wallet ${address}"`);
10007
+ printOut(` more ways to get U: ${BSC_TESTNET_U_FAUCET_URL2}`);
9997
10008
  printOut("(Faucets are needed only for paid models / on-chain settle.");
9998
10009
  printOut(" The default `auto/free` LLM model and AgentCore deploy");
9999
10010
  printOut(" do NOT require any funds.)");
@@ -10790,9 +10801,8 @@ function printNextSteps(name, provider, o = {}) {
10790
10801
  printOut(
10791
10802
  ` # ${nextStep}. (optional) fund the wallet \u2014 only when you need paid model / deploy / publish:`
10792
10803
  );
10793
- printOut(
10794
- " # testnet: send testnet BNB (gas) + testnet U to the address above"
10795
- );
10804
+ printOut(` # testnet tBNB: ${tbnbFaucetHint3()}`);
10805
+ printOut(` # testnet U: ${uFaucetHint3()}`);
10796
10806
  printOut(" # mainnet: swap a small amount via PancakeSwap:");
10797
10807
  printOut(
10798
10808
  " # https://pancakeswap.finance/swap?outputCurrency=0xcE24439F2D9C6a2289F741120FE202248B666666"
@@ -14038,7 +14048,9 @@ import {
14038
14048
  import {
14039
14049
  BSC_TESTNET_FAUCET_DOCS_URL,
14040
14050
  BSC_TESTNET_TBNB_TELEGRAM_FAUCET,
14041
- BSC_TESTNET_U_FAUCET_URL as BSC_TESTNET_U_FAUCET_URL2
14051
+ BSC_TESTNET_U_FAUCET_URL,
14052
+ tbnbFaucetHint as tbnbFaucetHint5,
14053
+ uFaucetHint as uFaucetHint5
14042
14054
  } from "@bnbagent/studio-runtime/networks";
14043
14055
 
14044
14056
  // src/cli/_deploy/checks/warning.ts
@@ -14047,7 +14059,12 @@ import * as fs33 from "fs";
14047
14059
  import * as path32 from "path";
14048
14060
  import { envLocalPath as envLocalPath15 } from "@bnbagent/studio-runtime/config";
14049
14061
  import { show } from "@bnbagent/studio-runtime/erc8004";
14050
- import { DEFAULT_RPC, getNetwork as getNetwork8 } from "@bnbagent/studio-runtime/networks";
14062
+ import {
14063
+ DEFAULT_RPC,
14064
+ getNetwork as getNetwork8,
14065
+ tbnbFaucetHint as tbnbFaucetHint4,
14066
+ uFaucetHint as uFaucetHint4
14067
+ } from "@bnbagent/studio-runtime/networks";
14051
14068
  import * as walletRt3 from "@bnbagent/studio-runtime/wallet";
14052
14069
  var TBNB_MIN_WEI = 7n * 10n ** 15n;
14053
14070
  function isFile14(p) {
@@ -14063,11 +14080,12 @@ async function checkWalletBalancesAllZero(root, _target) {
14063
14080
  return [];
14064
14081
  }
14065
14082
  if (bals.bnbWei === 0n && bals.uRaw === 0n) {
14083
+ const fundingHint = bals.network === "bsc-testnet" ? `; tBNB: ${tbnbFaucetHint4(bals.address)}; U: ${uFaucetHint4(bals.address)}` : "";
14066
14084
  return [
14067
14085
  {
14068
14086
  level: Level.WARNING,
14069
14087
  name: "wallet_balances_all_zero",
14070
- message: `wallet ${bals.address} has 0 BNB and 0 U on ${bals.network}; fund it when you need a paid LLM model or on-chain settle (AgentCore deploy + auto/free model don't require funds)`,
14088
+ message: `wallet ${bals.address} has 0 BNB and 0 U on ${bals.network}; fund it when you need a paid LLM model or on-chain settle (AgentCore deploy + auto/free model don't require funds)${fundingHint}`,
14071
14089
  details: {
14072
14090
  address: bals.address,
14073
14091
  network: bals.network,
@@ -14129,11 +14147,12 @@ async function checkWalletUBalanceNonzero(root, _target) {
14129
14147
  if (bal === null || bal !== 0n) {
14130
14148
  return [];
14131
14149
  }
14150
+ const fundingHint = netName === "bsc-testnet" ? `; ${uFaucetHint4(address)}` : "";
14132
14151
  return [
14133
14152
  {
14134
14153
  level: Level.WARNING,
14135
14154
  name: "wallet_u_balance_nonzero",
14136
- message: `wallet ${address} has 0 U on ${netName}; buyer/seller flows will fail without funded U balance`,
14155
+ message: `wallet ${address} has 0 U on ${netName}; buyer/seller flows will fail without funded U balance${fundingHint}`,
14137
14156
  details: { address, balance_raw: 0, network: netName }
14138
14157
  }
14139
14158
  ];
@@ -14516,12 +14535,12 @@ var checkPlatformFundingHint = async (_root, _target) => [
14516
14535
  {
14517
14536
  level: Level.INFO,
14518
14537
  name: "platform_funding_hint",
14519
- message: `testnet trial \u2014 keep a little tBNB for gas and testnet $U for commerce. tBNB: message ${BSC_TESTNET_TBNB_TELEGRAM_FAUCET} (more options: ${BSC_TESTNET_FAUCET_DOCS_URL}) \xB7 $U: ${BSC_TESTNET_U_FAUCET_URL2}`,
14538
+ message: `testnet trial \u2014 keep a little tBNB for gas and testnet $U for commerce. tBNB: ${tbnbFaucetHint5()} \xB7 $U: ${uFaucetHint5()}`,
14520
14539
  details: {
14521
14540
  faucets: [
14522
14541
  BSC_TESTNET_TBNB_TELEGRAM_FAUCET,
14523
14542
  BSC_TESTNET_FAUCET_DOCS_URL,
14524
- BSC_TESTNET_U_FAUCET_URL2
14543
+ BSC_TESTNET_U_FAUCET_URL
14525
14544
  ]
14526
14545
  }
14527
14546
  }
@@ -18303,11 +18322,11 @@ import {
18303
18322
  BSC_MAINNET_MIN_U,
18304
18323
  BSC_TESTNET_MIN_BNB,
18305
18324
  BSC_TESTNET_MIN_U,
18306
- BSC_TESTNET_U_FAUCET_URL as BSC_TESTNET_U_FAUCET_URL3,
18307
18325
  ERC8183_SUBMIT_GAS_RESERVE_BNB,
18308
18326
  fromRaw as fromRaw4,
18309
18327
  getNetwork as getNetwork9,
18310
- tbnbFaucetHint as tbnbFaucetHint3
18328
+ tbnbFaucetHint as tbnbFaucetHint6,
18329
+ uFaucetHint as uFaucetHint6
18311
18330
  } from "@bnbagent/studio-runtime/networks";
18312
18331
  import { listModels as listModels2 } from "@bnbagent/studio-runtime/pieverse";
18313
18332
  import * as walletRt5 from "@bnbagent/studio-runtime/wallet";
@@ -19509,8 +19528,8 @@ async function checkBalances(projectRoot, data, networkOverride) {
19509
19528
  const isMainnet = name === "bsc-mainnet";
19510
19529
  const minBnb = isTestnet ? BSC_TESTNET_MIN_BNB : isMainnet ? BSC_MAINNET_MIN_BNB : 0;
19511
19530
  const minBnbWei = BigInt(Math.round(minBnb * 1e6)) * 10n ** 12n;
19512
- const bnbFaucetHint = isTestnet ? ` \u2014 ${tbnbFaucetHint3(address)}` : "";
19513
- const uFaucetHint = isTestnet ? ` \u2014 $U faucet: ${BSC_TESTNET_U_FAUCET_URL3}` : "";
19531
+ const bnbFaucetHint = isTestnet ? ` \u2014 ${tbnbFaucetHint6(address)}` : "";
19532
+ const uFundingHint = isTestnet ? ` \u2014 ${uFaucetHint6(address)}` : "";
19514
19533
  const bnbRaw = await readNativeBalanceRaw(address, name);
19515
19534
  const reserve = ERC8183_SUBMIT_GAS_RESERVE_BNB;
19516
19535
  const reserveHint = ` (each on-chain action reserves \u2248 ${reserve} BNB worst-case)`;
@@ -19557,7 +19576,7 @@ async function checkBalances(projectRoot, data, networkOverride) {
19557
19576
  out.push({
19558
19577
  name: "wallet U balance",
19559
19578
  status: WARN,
19560
- detail: `${uRaw} raw @ ${address} \u2014 need \u2265 ${minU} U on ${name} for one auto-topup chunk${uFaucetHint}`
19579
+ detail: `${uRaw} raw @ ${address} \u2014 need \u2265 ${minU} U on ${name} for one auto-topup chunk${uFundingHint}`
19561
19580
  });
19562
19581
  }
19563
19582
  return out;
@@ -19992,7 +20011,7 @@ import {
19992
20011
  import {
19993
20012
  fromRaw as fromRaw5,
19994
20013
  getNetwork as getNetwork10,
19995
- tbnbFaucetHint as tbnbFaucetHint4
20014
+ tbnbFaucetHint as tbnbFaucetHint7
19996
20015
  } from "@bnbagent/studio-runtime/networks";
19997
20016
  import * as walletRt6 from "@bnbagent/studio-runtime/wallet";
19998
20017
  import { Option as Option5 } from "commander";
@@ -20154,7 +20173,7 @@ async function precheckRegisterGas(wallet, network) {
20154
20173
  if (balance >= REGISTER_MIN_BNB) {
20155
20174
  return null;
20156
20175
  }
20157
- 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 \u2014 ${tbnbFaucetHint4(wallet.address)}`;
20176
+ 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 \u2014 ${tbnbFaucetHint7(wallet.address)}`;
20158
20177
  }
20159
20178
  function syncAgentRegistry(agentId, op) {
20160
20179
  try {
@@ -791,8 +791,8 @@ function packageRoot() {
791
791
  }
792
792
  }
793
793
  function studioCliVersion() {
794
- if ("0.0.13-alpha.4") {
795
- return "0.0.13-alpha.4";
794
+ if ("0.0.13-alpha.5") {
795
+ return "0.0.13-alpha.5";
796
796
  }
797
797
  const file = path3.join(packageRoot(), "package.json");
798
798
  const pkg = JSON.parse(fs3.readFileSync(file, "utf-8"));
@@ -18,7 +18,7 @@ import {
18
18
  runPlatformAccountCommand,
19
19
  trialFromDeployCliJson,
20
20
  withDeployFiles
21
- } from "./chunk-OFAD65VZ.js";
21
+ } from "./chunk-BCUJGB4Y.js";
22
22
  import "./chunk-RO726HJG.js";
23
23
  export {
24
24
  BNB_PLATFORM_API_URL,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bnbagent/studio-cli",
3
- "version": "0.0.13-alpha.4",
3
+ "version": "0.0.13-alpha.5",
4
4
  "description": "Skills-first toolkit and bag CLI for BNB Chain seller agents: ERC-8004 identity, ERC-8183 escrowed commerce, and x402 payments.",
5
5
  "keywords": [
6
6
  "bnb-chain",
@@ -54,7 +54,7 @@
54
54
  "tar": "^7.4.0",
55
55
  "viem": "^2.54.0",
56
56
  "yaml": "^2.9.0",
57
- "@bnbagent/studio-runtime": "0.0.13-alpha.4"
57
+ "@bnbagent/studio-runtime": "0.0.13-alpha.5"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@a2a-js/sdk": "^0.3.14",
@@ -112,7 +112,7 @@ Returns a rich table of checks across the `app/agent/` sub-project:
112
112
  | LLM provider key | API key env not set | Edit `.studio/.env.local` or export the right `*_API_KEY` |
113
113
  | Network reachable | RPC down/wrong URL | Override via `STUDIO_BSC_TESTNET_RPC=...` (testnet) / `STUDIO_BSC_RPC=...` (mainnet) - per-network env vars read by `@bnbagent/studio-runtime/networks` `getNetwork` |
114
114
  | Wallet tBNB balance | 0 tBNB | Message https://t.me/bnbchain_official_bot: `I would like to get tBNB to my wallet <address>` (more options: docs.bnbchain.org/bnb-smart-chain/developers/faucet/) |
115
- | Wallet U balance | 0 U | Transfer from holder, or ask for sponsor U |
115
+ | Wallet U balance | 0 U | Message https://t.me/bnbchain_official_bot: `I would like to get U to my wallet <address>` (more options: https://united-coin-u.github.io/u-faucet/) |
116
116
  | 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. |
117
117
 
118
118
  WARN-only items don't block; FAIL items do (exit 1).
@@ -190,7 +190,7 @@ Build a TodoWrite list. The shape depends on the `wallet kind`. The canonical 8-
190
190
  5. **Fund the wallet - OPTIONAL; do NOT block on it.** The default `auto/free` LLM model runs at $0 and AgentCore deploy consumes no wallet balance, so a brand-new seller can scaffold, run `bag dev`, and deploy with an empty wallet. `bag doctor` and `bag deploy` only **WARN** (never block) on zero balance. Funding is needed later only for: a paid LLM model, on-chain settle, paying positive-price ERC-8183 job buys, or buying/smoking a PAID B402 request. A FREE ERC-8183 buy needs no U escrow or ERC-20 approval, but still needs the ERC-8183 state-changing calls and their gas/paymaster path. A FREE B402/x402 request needs neither token funding nor a facilitator call. When funding is needed, the wallet uses **TWO distinct U balances on TWO chains** (same wallet address, same private key, different chains):
191
191
  - **tBNB (gas)** on BSC testnet: message the official Telegram bot https://t.me/bnbchain_official_bot with `I would like to get tBNB to my wallet <address>` (up to 0.3 tBNB/day; replies with the tx hash). More options: https://docs.bnbchain.org/bnb-smart-chain/developers/faucet/
192
192
  - **BSC mainnet U** (`0xcE24439F2D9C6a2289F741120FE202248B666666`) - for Pieverse LLM topup. Minimum **0.2 U** recommended (0.1 for activate + slack). Pieverse runs **only on mainnet chainId=56**; testnet U cannot pay for LLM credits. Acquire via PancakeSwap. Wallet-funded renewal stays off unless the operator explicitly enables it with `bag budget enable`; otherwise refill Account Balance with `bag llm topup` as needed.
193
- - **BSC testnet U** (`0xc70B8741B8B07A6d61E54fd4B20f22Fa648E5565`) - for ERC-8183 job payments if `[network].default = bsc-testnet`. Faucet: https://united-coin-u.github.io/u-faucet/ (paste the agent wallet address; see also `docs/guides/U-token-testnet.md`).
193
+ - **BSC testnet U** (`0xc70B8741B8B07A6d61E54fd4B20f22Fa648E5565`) - for ERC-8183 job payments if `[network].default = bsc-testnet`. Message the official Telegram bot https://t.me/bnbchain_official_bot with `I would like to get U to my wallet <address>`. More options: https://united-coin-u.github.io/u-faucet/ (see also `docs/guides/U-token-testnet.md`).
194
194
 
195
195
  Both U balances live in the **same agent wallet** - one address, same private key - just on different chains. Verify both with `bag wallet balance --all`.
196
196
 
@@ -116,7 +116,7 @@ Two assets, two different rules:
116
116
 
117
117
  **Hot-wallet rule**: fund only a few days of spend. The Agent wallet is an operational hot wallet, not a treasury - the on-chain balance is the one spending limit nothing can bypass. Studio's daily caps (`[budget].max_per_day_usd`) are in-process guardrails: real across CLI runs (persisted to `.studio/spend-ledger.json`), best-effort in the deployed runtime (in-memory, resets on cold start).
118
118
 
119
- Testnet faucet: https://www.bnbchain.org/en/testnet-faucet (tBNB fallback). Mainnet: U via PancakeSwap; keep BNB for ERC-8183 fund/settle.
119
+ On testnet, message https://t.me/bnbchain_official_bot with `I would like to get tBNB to my wallet <address>` for gas and `I would like to get U to my wallet <address>` for ERC-8183 U. More options: https://docs.bnbchain.org/bnb-smart-chain/developers/faucet/ (tBNB) and https://united-coin-u.github.io/u-faucet/ (U). Mainnet: U via PancakeSwap; keep BNB for ERC-8183 fund/settle.
120
120
 
121
121
  ## 4. SIWE binding (Pieverse) - ALWAYS bind before paying
122
122