@bnbagent/studio-cli 0.0.6-alpha.8 → 0.0.6-alpha.9

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 CHANGED
@@ -4533,7 +4533,17 @@ function printUBalanceShortfall(walletAddress, currentRaw, neededRaw, neededUsd,
4533
4533
  function writeEnvLocal(key, value, envPath = ".env.local") {
4534
4534
  return setEnvVar(envPath, key, value);
4535
4535
  }
4536
+ function ensureSiweCapable(wallet) {
4537
+ const probe = wallet.supports;
4538
+ if (typeof probe !== "function") return;
4539
+ if (probe.call(wallet, "sign.message")) return;
4540
+ const kind = wallet.kind;
4541
+ throw new PieverseCliError(
4542
+ `the ${kind ? `'${kind}' ` : ""}wallet cannot log in to Pieverse: SIWE requires an EIP-191 personal-sign ('sign.message'), which this wallet kind never supports. Pieverse LLM is not usable with this wallet \u2014 set [llm].provider in studio.toml to 'openrouter', 'openai', or 'anthropic' (with the matching API key in .studio/.env.local), or use an 'evm-local' or 'twak' wallet.`
4543
+ );
4544
+ }
4536
4545
  async function withSiweRetry(wallet, call, opts = {}) {
4546
+ ensureSiweCapable(wallet);
4537
4547
  let token = opts.sessionToken ?? await siweLogin(wallet);
4538
4548
  try {
4539
4549
  return await call(token);
@@ -4801,6 +4811,15 @@ async function cmdActivate(opts) {
4801
4811
  if (wallet === null) {
4802
4812
  return 2;
4803
4813
  }
4814
+ try {
4815
+ ensureSiweCapable(wallet);
4816
+ } catch (exc) {
4817
+ if (exc instanceof PieverseCliError) {
4818
+ printErr(`error: ${exc.message}`);
4819
+ return 2;
4820
+ }
4821
+ throw exc;
4822
+ }
4804
4823
  const pvCfg = loadPieverseConfig(cfg);
4805
4824
  const replace = opts.replace === true;
4806
4825
  let existingHash = !replace && pvCfg.key_hash ? String(pvCfg.key_hash) : null;
@@ -4824,6 +4843,10 @@ async function cmdActivate(opts) {
4824
4843
  try {
4825
4844
  await withSiweRetry(wallet, (token) => inspectKey(token, derivedHash));
4826
4845
  } catch (exc) {
4846
+ if (exc instanceof PieverseCliError) {
4847
+ printErr(`error: ${exc.message}`);
4848
+ return 2;
4849
+ }
4827
4850
  if (!(exc instanceof PieverseKeyNotFoundError)) {
4828
4851
  printErr(
4829
4852
  `error: could not verify the existing ${PIEVERSE_ENV_KEY} against Pieverse: ${errMessage(
@@ -7829,6 +7852,9 @@ async function cmdInit(nameArg, opts) {
7829
7852
  opts.llmProviderSource,
7830
7853
  isTty
7831
7854
  );
7855
+ if (llmProvider === null) {
7856
+ return 2;
7857
+ }
7832
7858
  let rails = await resolveRails(opts.rails, isTty);
7833
7859
  if (hasX402Face(faces) && rails === "8183") {
7834
7860
  rails = "both";
@@ -8902,8 +8928,9 @@ async function resolveLlmProviderForWallet(walletKind2, configuredProvider, valu
8902
8928
  if (explicitlyConfigured) {
8903
8929
  if (configuredProvider === "pieverse-llm") {
8904
8930
  printErr(
8905
- "warning: Altana + pieverse-llm has limited compatibility: `bag llm activate` and paid-model runtime credit renewal both require SIWE message signing, which Altana intentionally does not expose. An existing Pieverse API key is usable only with the free `auto/free` model; use openrouter, openai, or anthropic for paid models."
8931
+ "error: --wallet-kind altana cannot be combined with --llm-provider pieverse-llm: `bag llm activate` and paid-model runtime credit renewal both require SIWE message signing, which Altana intentionally does not expose \u2014 activation can never succeed. Use --llm-provider openrouter, openai, or anthropic (each needs only an API key)."
8906
8932
  );
8933
+ return null;
8907
8934
  }
8908
8935
  return configuredProvider;
8909
8936
  }
@@ -9751,20 +9778,7 @@ function printNextSteps(name, provider, o = {}) {
9751
9778
  }
9752
9779
  printOut("");
9753
9780
  let nextStep;
9754
- if (provider === "pieverse-llm" && walletKind2 === "altana") {
9755
- printOut(
9756
- " # Pieverse `bag llm activate` needs generic SIWE message signing, which"
9757
- );
9758
- printOut(
9759
- " # Altana intentionally does not expose. Runtime paid-model credit renewal"
9760
- );
9761
- printOut(
9762
- " # needs the same SIWE flow, so an existing key works only with auto/free."
9763
- );
9764
- printOut(" # Use openrouter/openai/anthropic for paid models.");
9765
- printOut("");
9766
- nextStep = 3;
9767
- } else if (provider === "pieverse-llm") {
9781
+ if (provider === "pieverse-llm") {
9768
9782
  printOut(" # 3. activate Pieverse LLM (zero-deposit by default)");
9769
9783
  printOut(
9770
9784
  " # SIWE login + create API key with $0 allocation. Default model"
@@ -11641,12 +11655,18 @@ async function checkAgentcoreQuotaHeadroom(root, target) {
11641
11655
  }
11642
11656
  ];
11643
11657
  }
11658
+ const quotaRunbook = `Raising ${AGENTCORE_AGENT_QUOTA_CODE} ("Total Agents per Account") is a manual AWS step \u2014 \`bag\` cannot request it for you:
11659
+ 1. Open the AWS Service Quotas console (service "Amazon Bedrock AgentCore", region ${region}) and request an increase; low requests may need an AWS support case, and a first request can be rejected.
11660
+ 2. Check where an earlier request stands: aws service-quotas list-requested-service-quota-change-history --service-code bedrock-agentcore --region ${region}
11661
+ 3. While the increase is pending, deploy to the managed platform instead: bag deploy --provider bnb`;
11662
+ const message = limit <= 0 ? `AgentCore quota is 0 in ${region} (new accounts can start at zero), so ANY deploy would fail with \`maxAgents limit exceeded\` AFTER pushing the image and creating the secret, M2M client, and execution role (all orphans). ${quotaRunbook}` : `AgentCore runtimes: ${used}/${limit} used in ${region} \u2014 no slots left, so the deploy would fail with \`maxAgents limit exceeded\` AFTER pushing the image and creating the secret, M2M client, and execution role (all orphans). Delete a runtime you no longer need (\`bag deploy destroy\` in its workspace), or raise the quota. ${quotaRunbook}`;
11644
11663
  return [
11645
11664
  {
11646
11665
  level: Level.CRITICAL,
11647
11666
  name: "agentcore_quota_headroom",
11648
- message: `AgentCore runtimes: ${used}/${limit} used in ${region} \u2014 no slots left, so the deploy would fail with \`maxAgents limit exceeded\` AFTER pushing the image and creating the secret, M2M client, and execution role (all orphans). Delete a runtime you no longer need (\`bag deploy destroy\` in its workspace) or request a quota increase for ${AGENTCORE_AGENT_QUOTA_CODE} ("Total Agents per Account") in the Service Quotas console.`,
11649
- details
11667
+ message,
11668
+ details,
11669
+ fixCmd: `# raise ${AGENTCORE_AGENT_QUOTA_CODE} in the AWS Service Quotas console (manual), or deploy with: bag deploy --provider bnb`
11650
11670
  }
11651
11671
  ];
11652
11672
  }
@@ -16956,6 +16976,14 @@ async function checkLlm(data, projectRoot) {
16956
16976
  });
16957
16977
  }
16958
16978
  if (provider === "pieverse-llm") {
16979
+ const walletKind2 = String(tableOf14(data, "wallet").kind ?? "");
16980
+ if (walletKind2 === "altana") {
16981
+ out.push({
16982
+ name: "pieverse wallet compatibility",
16983
+ status: FAIL,
16984
+ detail: "wallet kind 'altana' cannot log in to Pieverse (SIWE needs EIP-191 'sign.message', which altana never exposes) \u2014 `bag llm activate` will always fail. Set [llm].provider to 'openrouter', 'openai', or 'anthropic' in studio.toml."
16985
+ });
16986
+ }
16959
16987
  out.push(...await checkPieverse(data, keyValue));
16960
16988
  }
16961
16989
  return out;
@@ -20580,7 +20608,7 @@ function buildProgram() {
20580
20608
  return program;
20581
20609
  }
20582
20610
  function cliVersion() {
20583
- return "0.0.6-alpha.8";
20611
+ return "0.0.6-alpha.9";
20584
20612
  }
20585
20613
 
20586
20614
  // src/cli/updateCheck.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bnbagent/studio-cli",
3
- "version": "0.0.6-alpha.8",
3
+ "version": "0.0.6-alpha.9",
4
4
  "description": "The `bag` CLI: scaffold, run, deploy, and monetize a single seller agent on BNB Chain (ERC-8004 identity, ERC-8183 commerce, x402 payments).",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -38,7 +38,7 @@
38
38
  "tar": "^7.4.0",
39
39
  "viem": "^2.54.0",
40
40
  "yaml": "^2.9.0",
41
- "@bnbagent/studio-runtime": "0.0.6-alpha.8"
41
+ "@bnbagent/studio-runtime": "0.0.6-alpha.9"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@a2a-js/sdk": "^0.3.14",
@@ -87,6 +87,7 @@ bag deploy --provider aws
87
87
  - **Permission denials (AccessDenied)** - the deploy identity is missing one of the least-privilege statements; apply the policy JSON from `docs/guides/agentcore-deploy-iam.md`. The deploy CLI preflight-simulates its permissions when it can and names the denied actions.
88
88
  - **Wrong account** - the credentials in the environment resolve to an account that does not match `agentcore/aws-targets.json`; fix the env vars / `~/.aws/credentials` profile, not the descriptor.
89
89
  - **Container build fails / hangs** (twak) - the image is built LOCALLY for linux/arm64 and pushed to ECR; Docker must be running (x86 machines need buildx/containerd cross-build support).
90
+ - **`agentcore_quota_headroom` CRITICAL (quota 0 or full)** - the `L-F4575653` ("Total Agents per Account") quota has no free slot; new accounts can start at an applied quota of ZERO even though the console shows a higher default. Raising it is a manual AWS step (`bag` and the AWS CLI cannot request it): open the Service Quotas console for "Amazon Bedrock AgentCore" in the target region and request an increase — low first requests are sometimes rejected and need an AWS support case. Check where an earlier request stands with `aws service-quotas list-requested-service-quota-change-history --service-code bedrock-agentcore --region <region>` (a `CASE_CLOSED` entry without a quota change means it was rejected — escalate via support). While the increase is pending, deploy to the managed platform instead: `bag deploy --provider bnb`. If the quota is full but nonzero, `bag deploy destroy` in an old workspace frees a slot.
90
91
 
91
92
  ### C. Inspect / operate
92
93
 
@@ -12,7 +12,7 @@ Altana separates trusted administration from runtime authority:
12
12
  - `WALLET_PASSWORD` is admin-only. The Agent gets `ALTANA_SESSION`, never the password or admin keystore.
13
13
  - Generic signing is refused. ERC-8183 uses `sessionQuoteSigner()` and the approved quote checker.
14
14
  - Deployment ships ONLY the serialized session as the `ALTANA_SESSION` runtime secret; the admin keystore and `WALLET_PASSWORD` never leave the operator machine. Renewal after expiry: `bag wallet session grant --force`, then re-run `bag deploy` (readiness warns under 7 days remaining). `bag deploy verify` needs `--skip-register` (no generic signing for the ERC-8004 register).
15
- - Altana refuses generic message signing, so Pieverse SIWE cannot authenticate either `bag llm activate` or runtime credit renewal. An existing Pieverse key is usable only with `auto/free`; use OpenRouter, OpenAI, or Anthropic for paid models.
15
+ - Altana refuses generic message signing, so Pieverse SIWE cannot authenticate `bag llm activate` or runtime credit renewal. `bag init --wallet-kind altana --llm-provider pieverse-llm` is rejected outright; use OpenRouter, OpenAI, or Anthropic (API-key providers). `bag llm activate` and `bag doctor` also flag the combination on projects edited by hand.
16
16
 
17
17
  ## Procedure
18
18