@bnbagent/studio-cli 0.0.8 → 0.0.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
@@ -44,7 +44,7 @@ import {
44
44
  x402SellerIsFree,
45
45
  x402SellerPricingState,
46
46
  x402SellerUsesB402
47
- } from "./chunk-ODCZKKZJ.js";
47
+ } from "./chunk-YFEM4564.js";
48
48
  import {
49
49
  TWAK_CLI_MIN_VERSION,
50
50
  TWAK_CLI_VERSION,
@@ -222,7 +222,7 @@ import {
222
222
  var CAMPAIGN_DOC_URL = "https://www.bnbchain.org/en/blog/bnb-agent-studio-is-live-on-bnb-chain-ai-agents-from-one-prompt";
223
223
  var CAMPAIGN_CHECK_TIMEOUT_MS = 6e3;
224
224
  async function fetchCampaignActive() {
225
- const { bnbPlatformApiUrl: bnbPlatformApiUrl2 } = await import("./deployCli-VM5TYKQX.js");
225
+ const { bnbPlatformApiUrl: bnbPlatformApiUrl2 } = await import("./deployCli-NJFCWBSF.js");
226
226
  const controller = new AbortController();
227
227
  const timer = setTimeout(() => controller.abort(), CAMPAIGN_CHECK_TIMEOUT_MS);
228
228
  try {
@@ -3415,11 +3415,12 @@ function unavailableProvidersForProject(root) {
3415
3415
  }
3416
3416
  if (runtime === "azure-foundry") {
3417
3417
  const reason = "this project uses a different container adapter; scaffold an agentcore project before selecting this provider";
3418
+ const azureProtocolReason = "Azure Foundry deploy currently supports A2A projects only; use an A2A azure-foundry scaffold or AgentCore for MCP";
3418
3419
  return {
3419
- bnb: reason,
3420
3420
  aws: reason,
3421
3421
  ...azureProtocolUnsupported ? {
3422
- azure: "Azure Foundry deploy currently supports A2A projects only; use an A2A azure-foundry scaffold or AgentCore for MCP"
3422
+ bnb: azureProtocolReason,
3423
+ azure: azureProtocolReason
3423
3424
  } : {}
3424
3425
  };
3425
3426
  }
@@ -4545,6 +4546,18 @@ var azureFoundryChecks = [
4545
4546
  checkAltanaSdkResolvable,
4546
4547
  checkAltanaSessionNotInsideAgent
4547
4548
  ];
4549
+ var managedAzureFoundryChecks = [
4550
+ checkStackRuntimeAzure,
4551
+ checkEntrypointAndDockerfile,
4552
+ checkLlmExternalProviderReady,
4553
+ checkTwakCustomContractsUnsupported,
4554
+ checkTwakPasswordEnvSet,
4555
+ checkTwakCredentialsAvailable,
4556
+ checkAltanaCustomContractsUnsupported,
4557
+ checkAltanaSessionReady,
4558
+ checkAltanaSdkResolvable,
4559
+ checkAltanaSessionNotInsideAgent
4560
+ ];
4548
4561
 
4549
4562
  // src/cli/llm.ts
4550
4563
  import * as fs19 from "fs";
@@ -13425,8 +13438,9 @@ var checkPlatformLoggedIn = async (_root, _target) => {
13425
13438
  }
13426
13439
  ];
13427
13440
  };
13428
- var checkPlatformDockerAvailable = async (root, _target) => {
13429
- if (platformArtifact(loadAgent(root)) !== "container") return [];
13441
+ var checkPlatformDockerAvailable = async (root, target) => {
13442
+ if (target !== "platform-azure" && platformArtifact(loadAgent(root)) !== "container")
13443
+ return [];
13430
13444
  const docker = await whichBin("docker");
13431
13445
  if (docker === null) {
13432
13446
  return [
@@ -13563,6 +13577,17 @@ async function runPrepare(opts = {}) {
13563
13577
  }
13564
13578
  return new CheckResult(checks, target);
13565
13579
  }
13580
+ if (target === "platform-azure") {
13581
+ checks.push(...await runProducers(criticalChecks, root, target));
13582
+ checks.push(
13583
+ ...await runProducers(managedAzureFoundryChecks, root, target)
13584
+ );
13585
+ checks.push(...await runProducers(warningChecks, root, target));
13586
+ if (includeInfo) {
13587
+ checks.push(...await runProducers(infoChecks, root, target));
13588
+ }
13589
+ return new CheckResult(checks, target);
13590
+ }
13566
13591
  if (target === "azure-foundry") {
13567
13592
  checks.push(
13568
13593
  ...await runProducers(
@@ -14267,12 +14292,37 @@ function trialLine(trial) {
14267
14292
  }
14268
14293
  async function platformAgent(opts) {
14269
14294
  const root = opts.root;
14295
+ const backend = opts.backend ?? "aws";
14270
14296
  const isTty = opts.isTty ?? stdinIsTty;
14271
14297
  const ask = opts.promptUser ?? promptUser;
14272
14298
  warn(
14273
- "note: deploying to the BNB Chain managed platform \u2014 a 48h TESTNET trial sandbox (network is forced to bsc-testnet; the runtime is auto-reclaimed at 48h). Not a production seller."
14299
+ `note: deploying to the BNB Chain managed platform (backend=${backend}) \u2014 a 48h TESTNET trial sandbox (network is forced to bsc-testnet; the runtime is auto-reclaimed at 48h). Not a production seller.`
14274
14300
  );
14275
14301
  const platformCmd = opts.runPlatformCommand ?? runPlatformAccountCommand;
14302
+ if (backend === "azure") {
14303
+ const cfg2 = loadAgentCfg(root);
14304
+ const faces2 = stackFaces(tableOf12(cfg2, "stack"), tableOf12(cfg2, "payments"));
14305
+ const protocol2 = nativeProtocolOf(faces2);
14306
+ if (hasX402Face(faces2)) {
14307
+ warn(
14308
+ "error: x402 publication is not supported on the managed Azure backend. No build or upload was started."
14309
+ );
14310
+ return 1;
14311
+ }
14312
+ const runtimeProfile = protocol2 === "A2A" ? "foundry-responses-v1" : "foundry-invocations-v1";
14313
+ const capability = await platformCmd(["capabilities"], { json: true });
14314
+ const platform = isJsonObject(capability.data.platform) ? capability.data.platform : {};
14315
+ const backends = isJsonObject(platform.backends) ? platform.backends : {};
14316
+ const azure = isJsonObject(backends.azure) ? backends.azure : {};
14317
+ const profiles = Array.isArray(azure.runtimeProfiles) ? azure.runtimeProfiles.map(String) : [];
14318
+ const protocols = Array.isArray(azure.protocols) ? azure.protocols.map(String) : [];
14319
+ if (capability.code !== 0 || azure.enabled !== true || !profiles.includes(runtimeProfile) || !protocols.includes(protocol2)) {
14320
+ warn(
14321
+ `error: the managed platform does not currently accept Azure ${runtimeProfile}/${protocol2}. No build or upload was started.`
14322
+ );
14323
+ return capability.code || 1;
14324
+ }
14325
+ }
14276
14326
  const campaignProbe = opts.campaignActive ?? (async () => null);
14277
14327
  const trialRes = await platformCmd(["trial"], { json: true });
14278
14328
  if (trialRes.code !== 0) {
@@ -14306,7 +14356,7 @@ async function platformAgent(opts) {
14306
14356
  return rc;
14307
14357
  }
14308
14358
  }
14309
- const packaging = platformPackaging(root);
14359
+ const packaging = backend === "azure" ? "container" : platformPackaging(root);
14310
14360
  {
14311
14361
  const confirm = opts.confirmPackaging ?? ((r, p) => confirmPackagingDefault(r, p, {
14312
14362
  acceptRisk: opts.acceptRisk ?? false,
@@ -14376,7 +14426,8 @@ then re-run the deploy.`
14376
14426
  secrets,
14377
14427
  slug,
14378
14428
  cwd: agentDir,
14379
- extraArgs: opts.extraArgs ?? []
14429
+ extraArgs: opts.extraArgs ?? [],
14430
+ backend
14380
14431
  });
14381
14432
  if (res.code !== 0) {
14382
14433
  warn(
@@ -14405,7 +14456,7 @@ then re-run the deploy.`
14405
14456
  trial = trialFromJson(post.data);
14406
14457
  }
14407
14458
  }
14408
- recordDeployState(root, slug, dep);
14459
+ recordDeployState(root, slug, dep, backend);
14409
14460
  recordShippedWallet(root, secrets);
14410
14461
  refreshTrialCache(root, {
14411
14462
  expiresAt: trial.expiresAt,
@@ -14416,7 +14467,7 @@ then re-run the deploy.`
14416
14467
  ` : "";
14417
14468
  emit(
14418
14469
  `
14419
- \u2713 deployed to the platform (slug=${slug}).
14470
+ \u2713 deployed to the platform (backend=${backend}, slug=${slug}).
14420
14471
  deployment: ${dep.deploymentId}
14421
14472
  invoke URL: ${dep.invokeUrl || "<pending \u2014 see `bag deploy status`>"}
14422
14473
  ${trialLine(trial)}
@@ -14433,7 +14484,7 @@ async function termsConsentGate(root, deps) {
14433
14484
  return null;
14434
14485
  }
14435
14486
  warn(
14436
- "=== Platform trial terms (first deploy) ===\nThis deploys into the BNB Chain operator's AWS account as a 48h testnet trial. A runtime signing key (your configured or a throwaway wallet) is transmitted to the operator's Secrets Manager for the runtime to sign with \u2014 testnet-scoped, auto-reclaimed at 48h. By proceeding you accept these trial terms."
14487
+ "=== Platform trial terms (first deploy) ===\nThis deploys into a BNB Chain operator-managed cloud account as a 48h testnet trial. A runtime signing key (your configured or a throwaway wallet) is transmitted to the operator's managed secret channel for the runtime to sign with \u2014 testnet-scoped, auto-reclaimed at 48h. By proceeding you accept these trial terms."
14437
14488
  );
14438
14489
  if (deps.acceptRisk) {
14439
14490
  return stampTerms(root) ? null : 1;
@@ -14490,7 +14541,7 @@ function walletWarning(root, secrets) {
14490
14541
  warn(
14491
14542
  `
14492
14543
  [expected \xB7 bounded Altana session]
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.
14544
+ This project's bounded Altana session${who2} will be transmitted through the BNB Chain operator's managed secret channel 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.
14494
14545
  If the current budget or expiry is wider than you want an operator-held key to carry, stop and grant a tighter one first:
14495
14546
  bag wallet session grant --force --budget-u <small> --expiry-days <short>
14496
14547
  You can revoke it on-chain at any time with \`bag wallet session revoke\`.
@@ -14502,16 +14553,17 @@ function walletWarning(root, secrets) {
14502
14553
  warn(
14503
14554
  `
14504
14555
  !!! wallet exposure (platform trial) !!!
14505
- This project's wallet ${who} will be transmitted to the BNB Chain operator's Secrets Manager so the trial runtime can sign on testnet \u2014 expected for the platform trial, and testnet-scoped.
14556
+ This project's wallet ${who} will be transmitted through the BNB Chain operator's managed secret channel so the trial runtime can sign on testnet \u2014 expected for the platform trial, and testnet-scoped.
14506
14557
  If this address is one you also use elsewhere (especially on mainnet), stop and deploy with a fresh throwaway instead:
14507
14558
  bag wallet new
14508
14559
  Otherwise proceed. Reusing this address on mainnet later is discouraged.
14509
14560
  `
14510
14561
  );
14511
14562
  }
14512
- function recordDeployState(root, slug, dep) {
14563
+ function recordDeployState(root, slug, dep, backend = "aws") {
14513
14564
  recordPlatformKv(root, "slug", slug);
14514
14565
  recordPlatformKv(root, "deployment_id", dep.deploymentId);
14566
+ recordPlatformKv(root, "backend", backend);
14515
14567
  if (dep.agentId) {
14516
14568
  recordPlatformKv(root, "agent_id", dep.agentId);
14517
14569
  }
@@ -14617,6 +14669,7 @@ function printAgentClientPrompt(root, invokeUrl, status) {
14617
14669
  const base = access.base;
14618
14670
  const tokenUrl = access.tokenUrl;
14619
14671
  const deploymentId = String(platformCfg(root).deployment_id || "n/a");
14672
+ const managedBackend = platformCfg(root).backend === "azure" ? "azure" : "aws";
14620
14673
  const selftestLine = "- Quick self-test (operator): run `bag deploy info --with-curl`";
14621
14674
  const rt = agentId ? `${base}/v1/rt/${agentId}` : `${base}/v1/rt/<agentId>`;
14622
14675
  const cardUrl = `${rt}/.well-known/agent-card.json`;
@@ -14696,7 +14749,7 @@ function printAgentClientPrompt(root, invokeUrl, status) {
14696
14749
  "- The anonymous x402 route does not use the OAuth2 token flow shown for ERC-8183."
14697
14750
  ],
14698
14751
  ...!x402Only && hasA2aFace(faces) ? [
14699
- '- A2A callers: send the payload as a DATA part, NOT text \u2014 parts:[{"kind":"data","data":{ ...payload above... }}]. A JSON string in a "text" part is rejected (the runtime only reads data parts, so no skill is parsed).'
14752
+ managedBackend === "azure" ? '- A2A callers: Foundry incoming A2A is text-only. Send the payload as a JSON-string TEXT part \u2014 parts:[{"kind":"text","text":"{\\"skill\\":\\"negotiate\\",...}"}].' : '- A2A callers: send the payload as a DATA part, NOT text \u2014 parts:[{"kind":"data","data":{ ...payload above... }}]. A JSON string in a "text" part is rejected (the runtime only reads data parts, so no skill is parsed).'
14700
14753
  ] : [],
14701
14754
  "",
14702
14755
  "YOUR TASK",
@@ -14892,6 +14945,9 @@ var ADVERTISED_DEPLOY_RUNTIME_TARGETS = ["agentcore"];
14892
14945
  // src/cli/deploy.ts
14893
14946
  var TARGET_CHOICES = [...DEPLOY_RUNTIME_TARGETS];
14894
14947
  var ADVERTISED_TARGET_CHOICES = [...ADVERTISED_DEPLOY_RUNTIME_TARGETS];
14948
+ function runtimeSecretsForManagedBackend(backend) {
14949
+ return backend === "azure" ? collectAzureSecretPayload : collectRuntimeSecrets;
14950
+ }
14895
14951
  function isFile16(p) {
14896
14952
  try {
14897
14953
  return fs38.statSync(p).isFile();
@@ -14958,7 +15014,12 @@ function registerDeploy(program) {
14958
15014
  PROVIDER_MENU_ORDER,
14959
15015
  ADVERTISED_PROVIDERS
14960
15016
  );
14961
- p.addOption(providerOption()).option("--project-root <path>", "Override project root.").option("--skip-prepare", "Skip non-storage local readiness checks.").option(
15017
+ p.addOption(providerOption()).addOption(
15018
+ new Option4(
15019
+ "--backend <backend>",
15020
+ "Managed backend confirmation for --provider bnb (aws or azure). It must match [stack].runtime."
15021
+ ).choices(["aws", "azure"])
15022
+ ).option("--project-root <path>", "Override project root.").option("--skip-prepare", "Skip non-storage local readiness checks.").option(
14962
15023
  "--force-deploy-broken-storage",
14963
15024
  "DANGEROUS: bypass fatal deliverable-storage checks."
14964
15025
  ).option("--force", "Bypass explicitly forceable readiness checks.").addOption(
@@ -14976,7 +15037,12 @@ function registerDeploy(program) {
14976
15037
  ).action(act((opts) => cmdPrepare(opts)));
14977
15038
  p.command("agent").description(
14978
15039
  "Deprecated compatibility alias for `bag deploy`. Thin wrapper: gates on prepare, syncs runtime secrets, builds the agent (`pnpm build`), delegates to the platform CLI."
14979
- ).addOption(providerOption()).addOption(runtimeOption()).addOption(targetAlias()).addOption(
15040
+ ).addOption(providerOption()).addOption(
15041
+ new Option4(
15042
+ "--backend <backend>",
15043
+ "Managed backend confirmation for --provider bnb (aws or azure). It must match [stack].runtime."
15044
+ ).choices(["aws", "azure"])
15045
+ ).addOption(runtimeOption()).addOption(targetAlias()).addOption(
14980
15046
  new Option4(
14981
15047
  "--to <destination>",
14982
15048
  "Deploy destination override: self (your own cloud) or platform (the managed BNB Chain trial). Default: studio.toml [deploy].destination, else self."
@@ -15038,10 +15104,10 @@ function registerDeploy(program) {
15038
15104
  )
15039
15105
  );
15040
15106
  p.command("info").description(
15041
- "Show the buyer-access surface for a platform deploy (URL, token endpoint, scope, agentId)."
15107
+ "Show the buyer-access surface for a platform or Azure self-deploy."
15042
15108
  ).option("--project-root <path>", "Override project root.").option("--json", "Emit JSON instead of a table.").option(
15043
15109
  "--with-curl",
15044
- "Also print a copy-paste curl chain (client_credentials token + invoke)."
15110
+ "Also print a copy-paste authentication + invoke curl chain."
15045
15111
  ).action(
15046
15112
  act(
15047
15113
  (opts) => cmdInfo(opts)
@@ -15665,6 +15731,37 @@ async function cmdAgent(opts, agentcoreArgs) {
15665
15731
  const root = resolveProjectRoot2(opts.projectRoot);
15666
15732
  const destination = opts.provider ? opts.provider === "bnb" ? "platform" : "self" : opts.to ?? opts.destination ?? agentDeployDestination(root);
15667
15733
  const packagingDestination = opts.to ?? opts.destination ?? agentDeployDestination(root);
15734
+ let managedBackend;
15735
+ if (destination === "platform") {
15736
+ const runtime = readStackRuntime(root) ?? "agentcore";
15737
+ managedBackend = runtime === "azure-foundry" ? "azure" : "aws";
15738
+ if (opts.backend && opts.backend !== managedBackend) {
15739
+ printErr(
15740
+ `error: --backend=${opts.backend} conflicts with [stack].runtime='${runtime}', which requires backend=${managedBackend}. --backend confirms the recipe target; it does not convert recipes across clouds.`
15741
+ );
15742
+ return 2;
15743
+ }
15744
+ if (managedBackend === "azure" && !opts.backend) {
15745
+ if (!stdinIsTty()) {
15746
+ printErr(
15747
+ "error: an azure-foundry project requires explicit --backend azure in a non-interactive terminal."
15748
+ );
15749
+ return 2;
15750
+ }
15751
+ const answer = await promptUser(
15752
+ "This azure-foundry project will use the managed Azure backend. Continue? [y/N] "
15753
+ );
15754
+ if (!["y", "yes"].includes(answer.trim().toLowerCase())) {
15755
+ printErr("cancelled: managed Azure backend was not confirmed.");
15756
+ return 2;
15757
+ }
15758
+ }
15759
+ } else if (opts.backend) {
15760
+ printErr(
15761
+ `error: --backend is accepted only with --provider bnb; --provider ${opts.provider ?? "self"} selects a user-owned cloud directly.`
15762
+ );
15763
+ return 2;
15764
+ }
15668
15765
  if (destination === "platform") {
15669
15766
  const networkGate = rejectPlatformMainnet(root);
15670
15767
  if (networkGate !== null) return networkGate;
@@ -15691,14 +15788,15 @@ async function cmdAgent(opts, agentcoreArgs) {
15691
15788
  }
15692
15789
  return platformAgent({
15693
15790
  root,
15791
+ backend: managedBackend,
15694
15792
  acceptRisk: opts.acceptRisk,
15695
15793
  skipPrepare: opts.skipPrepare,
15696
15794
  force: opts.force,
15697
15795
  // The deploy layer injects the shared secret collector + prepare gate
15698
15796
  // so the self-deploy and platform secret/readiness surfaces never
15699
15797
  // drift (the Python `_collect_runtime_secrets` / `run_prepare` share).
15700
- collectRuntimeSecrets,
15701
- runPrepareGate: platformPrepareGate(opts),
15798
+ collectRuntimeSecrets: runtimeSecretsForManagedBackend(managedBackend),
15799
+ runPrepareGate: platformPrepareGate(opts, managedBackend),
15702
15800
  extraArgs: stripLeadingDdash2(agentcoreArgs)
15703
15801
  });
15704
15802
  }
@@ -15901,10 +15999,10 @@ function recordOf2(data) {
15901
15999
  function stripLeadingDdash2(extra) {
15902
16000
  return extra.length > 0 && extra[0] === "--" ? extra.slice(1) : extra;
15903
16001
  }
15904
- function platformPrepareGate(opts) {
16002
+ function platformPrepareGate(opts, backend = "aws") {
15905
16003
  return async (root, force) => {
15906
16004
  let result = await runPrepare({
15907
- target: "platform",
16005
+ target: backend === "azure" ? "platform-azure" : "platform",
15908
16006
  projectRoot: root,
15909
16007
  includeInfo: false,
15910
16008
  force
@@ -15968,6 +16066,7 @@ function agentProtocolOf(agentRoot2) {
15968
16066
  return nativeProtocolOf(agentFacesOf(agentRoot2));
15969
16067
  }
15970
16068
  var GUIDE_URL2 = "https://github.com/bnb-chain/bnbagent-studio/blob/main/docs/guides/agentcore-a2a-access.md";
16069
+ var FOUNDRY_GUIDE_URL = "https://github.com/bnb-chain/bnbagent-studio/blob/main/docs/guides/foundry-a2a-access.md";
15971
16070
  function oauthFactsForAgentcore(agentRoot2) {
15972
16071
  const summary = accessSummaryForAgentcore(agentRoot2);
15973
16072
  if (summary === null) {
@@ -16012,8 +16111,12 @@ async function printAccessNextSteps2(root, runtime, opts = {}) {
16012
16111
  }
16013
16112
  return;
16014
16113
  }
16114
+ const invokeUrl = opts.invokeUrl ?? recordedEndpoint(root);
16115
+ if (invokeUrl) {
16116
+ printOut(` endpoint: ${invokeUrl}`);
16117
+ }
16015
16118
  printOut(
16016
- " Azure Foundry buyer access is in Preview \u2014 see docs/guides/foundry-a2a-access.md in the bnbagent-studio repo. The per-agent A2A card URL and OAuth scope are confirmed only after a live deploy."
16119
+ ` Azure Foundry access uses a Microsoft Entra bearer token. Run \`bag deploy info --with-curl\` for the exact endpoint, token resource, and Invocations request body; see ${FOUNDRY_GUIDE_URL}.`
16017
16120
  );
16018
16121
  }
16019
16122
  var CLIENT_PROMPT_RULE2 = "\u2500".repeat(62);
@@ -16417,6 +16520,96 @@ Quick-verify x402 endpoint:
16417
16520
  "\n Note: this only exercises `negotiate` (a read-only quote). To get a deliverable you must fund a job on-chain (ERC-8183 createJob -> registerJob -> setBudget -> fund), then call `notify_funded` with that job_id and poll the chain for SUBMITTED \u2014 see the emitted client prompt / `bnbagent-studio-buying-via-8183`."
16418
16521
  );
16419
16522
  }
16523
+ var AZURE_FOUNDRY_TOKEN_RESOURCE = "https://ai.azure.com";
16524
+ var AZURE_FOUNDRY_TOKEN_SCOPE = `${AZURE_FOUNDRY_TOKEN_RESOURCE}/.default`;
16525
+ function azureQuickVerifyBody() {
16526
+ return {
16527
+ input: JSON.stringify({
16528
+ skill: "negotiate",
16529
+ task_description: "Create a concise launch checklist",
16530
+ terms: {
16531
+ deliverables: "A 5-item checklist",
16532
+ quality_standards: "Clear and actionable"
16533
+ }
16534
+ })
16535
+ };
16536
+ }
16537
+ function printAzureInfo(deployment, opts) {
16538
+ const endpoint = deployment.endpoint;
16539
+ if (!endpoint) {
16540
+ if (opts.json) {
16541
+ printOut(
16542
+ JSON.stringify(
16543
+ {
16544
+ provider: "azure",
16545
+ target: deployment.target,
16546
+ name: deployment.name,
16547
+ endpoint: null,
16548
+ error: "No Azure invocation endpoint is recorded."
16549
+ },
16550
+ null,
16551
+ 2
16552
+ )
16553
+ );
16554
+ } else {
16555
+ printErr(
16556
+ "Azure deployment is recorded but has no invocation endpoint. Run `bag deploy status --provider azure` and redeploy if the live endpoint cannot be recovered."
16557
+ );
16558
+ }
16559
+ return 1;
16560
+ }
16561
+ const body = azureQuickVerifyBody();
16562
+ if (opts.json) {
16563
+ printOut(
16564
+ JSON.stringify(
16565
+ {
16566
+ provider: "azure",
16567
+ target: deployment.target,
16568
+ name: deployment.name,
16569
+ deployment_id: deployment.deploymentId,
16570
+ endpoint,
16571
+ authentication: {
16572
+ type: "entra_bearer",
16573
+ resource: AZURE_FOUNDRY_TOKEN_RESOURCE,
16574
+ scope: AZURE_FOUNDRY_TOKEN_SCOPE
16575
+ },
16576
+ request: {
16577
+ method: "POST",
16578
+ content_type: "application/json",
16579
+ body
16580
+ }
16581
+ },
16582
+ null,
16583
+ 2
16584
+ )
16585
+ );
16586
+ return 0;
16587
+ }
16588
+ printOut("bag deploy info \u2014 Azure Foundry self-deploy");
16589
+ printOut(` endpoint: ${endpoint}`);
16590
+ printOut(
16591
+ ` authentication: Microsoft Entra bearer token (resource ${AZURE_FOUNDRY_TOKEN_RESOURCE}; SDK scope ${AZURE_FOUNDRY_TOKEN_SCOPE})`
16592
+ );
16593
+ printOut(" request: POST application/json");
16594
+ printOut(` body: ${JSON.stringify(body)}`);
16595
+ if (opts.withCurl) {
16596
+ printOut("\nQuick-verify curl:");
16597
+ printOut(
16598
+ ` AZURE_TOKEN=$(az account get-access-token --resource ${AZURE_FOUNDRY_TOKEN_RESOURCE} --query accessToken -o tsv)`
16599
+ );
16600
+ printOut(` AZURE_ENDPOINT=${JSON.stringify(endpoint)}`);
16601
+ printOut(
16602
+ ` curl -sS -X POST "$AZURE_ENDPOINT" \\
16603
+ -H "Authorization: Bearer $AZURE_TOKEN" \\
16604
+ -H "Content-Type: application/json" \\
16605
+ -d '${JSON.stringify(body)}'`
16606
+ );
16607
+ printOut(
16608
+ "\n The Azure CLI command is only a convenient way to mint a token for this curl. Deployment itself does not require az/azd; DefaultAzureCredential or ClientSecretCredential can mint the same scope in an application."
16609
+ );
16610
+ }
16611
+ return 0;
16612
+ }
16420
16613
  async function cmdInfo(opts) {
16421
16614
  const rc = applyProjectRoot(opts.projectRoot, false);
16422
16615
  if (rc !== null) {
@@ -16424,7 +16617,8 @@ async function cmdInfo(opts) {
16424
16617
  }
16425
16618
  const root = resolveProjectRoot2(opts.projectRoot);
16426
16619
  const workspaceRoot = deployWorkspaceRoot2(root);
16427
- const hasBnbDeployment = discoverRecordedDeployments(workspaceRoot).some(
16620
+ const recorded = discoverRecordedDeployments(workspaceRoot);
16621
+ const hasBnbDeployment = recorded.some(
16428
16622
  (deployment) => deployment.provider === "bnb"
16429
16623
  );
16430
16624
  if (hasBnbDeployment) {
@@ -16434,6 +16628,12 @@ async function cmdInfo(opts) {
16434
16628
  }
16435
16629
  return infoRc;
16436
16630
  }
16631
+ const azureDeployment = recorded.find(
16632
+ (deployment) => deployment.provider === "azure"
16633
+ );
16634
+ if (azureDeployment) {
16635
+ return printAzureInfo(azureDeployment, opts);
16636
+ }
16437
16637
  printErr(
16438
16638
  "`bag deploy info` reports the platform buyer-access surface; this project has no recorded BNB deployment. Use `bag deploy status` to inspect recorded providers."
16439
16639
  );
@@ -16571,10 +16771,10 @@ async function cmdLogs(opts) {
16571
16771
  if (deployment.provider === "aws" && opts.since) {
16572
16772
  argv.push("--since", opts.since);
16573
16773
  }
16574
- if (deployment.provider === "azure" && opts.limit) {
16774
+ if (opts.limit) {
16575
16775
  argv.push("--limit", opts.limit);
16576
16776
  }
16577
- if (deployment.provider === "azure" && opts.session) {
16777
+ if (opts.session) {
16578
16778
  argv.push("--session", opts.session);
16579
16779
  }
16580
16780
  return runDeployCliStream(argv, {
@@ -820,7 +820,7 @@ function isTable(value) {
820
820
  }
821
821
 
822
822
  // src/cli/_deploy/deployCli.ts
823
- var DEPLOY_CLI_VERSION = "0.4.14";
823
+ var DEPLOY_CLI_VERSION = "0.5.4";
824
824
  var DEPLOY_CLI_PACKAGE = `@bnbagent/deploy-cli@${DEPLOY_CLI_VERSION}`;
825
825
  var BNB_PLATFORM_API_URL = "https://bnbagent-api.bnbchain.world";
826
826
  var BNB_PLATFORM_API_URL_ENV = "BNBAGENT_API_URL";
@@ -992,7 +992,12 @@ function buildDeploySpec(root, opts) {
992
992
  }
993
993
  }
994
994
  deploy.protocol = protocol;
995
- doc.bnb = { apiUrl: bnbPlatformApiUrl() };
995
+ const stackRuntime = String(stack.runtime ?? "agentcore");
996
+ doc.bnb = stackRuntime === "azure-foundry" ? {
997
+ apiUrl: bnbPlatformApiUrl(),
998
+ backend: "azure",
999
+ runtimeProfile: protocol === "A2A" ? "foundry-responses-v1" : "foundry-invocations-v1"
1000
+ } : { apiUrl: bnbPlatformApiUrl() };
996
1001
  }
997
1002
  if (opts.inlineSecrets) {
998
1003
  Object.assign(env, opts.inlineSecrets);
@@ -18,7 +18,7 @@ import {
18
18
  runPlatformAccountCommand,
19
19
  trialFromDeployCliJson,
20
20
  withDeployFiles
21
- } from "./chunk-ODCZKKZJ.js";
21
+ } from "./chunk-YFEM4564.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.8",
3
+ "version": "0.0.9",
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",
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "@bnbagent/sdk": "0.5.0",
54
- "@bnbagent/studio-runtime": "0.0.8",
54
+ "@bnbagent/studio-runtime": "0.0.9",
55
55
  "ai": "^7.0.29",
56
56
  "archiver": "^8.0.0",
57
57
  "commander": "^15.0.0",
@@ -4,8 +4,9 @@
4
4
  * Generated by `bag init --runtime azure-foundry`. This is the
5
5
  * Foundry-hosted counterpart of the cloud-neutral A2A entrypoint
6
6
  * (`main.ts`). The deploy spec declares Foundry's minimal pass-through
7
- * `invocations` protocol, so this host implements its documented container
8
- * contract: plain HTTP on :8088, GET /readiness, and POST /invocations.
7
+ * `invocations` protocol for user-owned Azure and the `responses` protocol
8
+ * for managed incoming A2A. This host implements both documented container
9
+ * endpoints on :8088 plus GET /readiness.
9
10
  *
10
11
  * ## How A2A reaches the seller skills on Foundry
11
12
  *
@@ -31,6 +32,7 @@
31
32
  * arrive as environment variables before the process starts.
32
33
  */
33
34
 
35
+ import { randomUUID } from "node:crypto";
34
36
  import { pathToFileURL } from "node:url";
35
37
  import { createOpenAI } from "@ai-sdk/openai";
36
38
  import { loadStudioToml } from "@bnbagent/studio-runtime/config";
@@ -234,6 +236,112 @@ export function extractEnvelope(
234
236
  : null;
235
237
  }
236
238
 
239
+ /** Extract the latest text turn from an OpenAI Responses request. Foundry's
240
+ * incoming A2A adapter is text-only and projects the caller message here. */
241
+ export function responsesInputText(input: unknown): string | null {
242
+ if (typeof input === "string") {
243
+ return input;
244
+ }
245
+ if (!Array.isArray(input)) {
246
+ return null;
247
+ }
248
+ const texts: string[] = [];
249
+ for (const item of input) {
250
+ if (typeof item === "string") {
251
+ texts.push(item);
252
+ continue;
253
+ }
254
+ if (!item || typeof item !== "object") {
255
+ continue;
256
+ }
257
+ const content = (item as Record<string, unknown>).content;
258
+ if (typeof content === "string") {
259
+ texts.push(content);
260
+ continue;
261
+ }
262
+ if (!Array.isArray(content)) {
263
+ continue;
264
+ }
265
+ for (const part of content) {
266
+ if (part && typeof part === "object") {
267
+ const text = (part as Record<string, unknown>).text;
268
+ if (typeof text === "string") texts.push(text);
269
+ }
270
+ }
271
+ }
272
+ return texts.at(-1) ?? null;
273
+ }
274
+
275
+ function responseId(prefix: string): string {
276
+ return `${prefix}_${randomUUID().replaceAll("-", "")}`;
277
+ }
278
+
279
+ function responseEnvelope(text: string, model: string) {
280
+ const responseIdValue = responseId("resp");
281
+ const messageId = responseId("msg");
282
+ const part = { type: "output_text", annotations: [], logprobs: [], text };
283
+ const item = {
284
+ id: messageId,
285
+ type: "message",
286
+ status: "completed",
287
+ role: "assistant",
288
+ content: [part],
289
+ };
290
+ return {
291
+ id: responseIdValue,
292
+ object: "response",
293
+ created_at: Math.floor(Date.now() / 1000),
294
+ status: "completed",
295
+ error: null,
296
+ incomplete_details: null,
297
+ instructions: null,
298
+ max_output_tokens: null,
299
+ model,
300
+ output: [item],
301
+ output_text: text,
302
+ parallel_tool_calls: true,
303
+ previous_response_id: null,
304
+ reasoning: { effort: null, summary: null },
305
+ store: true,
306
+ temperature: 1,
307
+ text: { format: { type: "text" } },
308
+ tool_choice: "auto",
309
+ tools: [],
310
+ top_p: 1,
311
+ truncation: "disabled",
312
+ usage: {
313
+ input_tokens: 0,
314
+ input_tokens_details: { cached_tokens: 0 },
315
+ output_tokens: 0,
316
+ output_tokens_details: { reasoning_tokens: 0 },
317
+ total_tokens: 0,
318
+ },
319
+ metadata: {},
320
+ };
321
+ }
322
+
323
+ function sendStreamingResponse(res: express.Response, response: ReturnType<typeof responseEnvelope>): void {
324
+ const item = response.output[0];
325
+ const part = item.content[0];
326
+ const events = [
327
+ { type: "response.created", sequence_number: 0, response: { ...response, status: "in_progress", output: [] } },
328
+ { type: "response.output_item.added", sequence_number: 1, output_index: 0, item: { ...item, status: "in_progress", content: [] } },
329
+ { type: "response.content_part.added", sequence_number: 2, output_index: 0, item_id: item.id, content_index: 0, part: { ...part, text: "" } },
330
+ { type: "response.output_text.delta", sequence_number: 3, output_index: 0, item_id: item.id, content_index: 0, delta: part.text },
331
+ { type: "response.output_text.done", sequence_number: 4, output_index: 0, item_id: item.id, content_index: 0, text: part.text },
332
+ { type: "response.content_part.done", sequence_number: 5, output_index: 0, item_id: item.id, content_index: 0, part },
333
+ { type: "response.output_item.done", sequence_number: 6, output_index: 0, item },
334
+ { type: "response.completed", sequence_number: 7, response },
335
+ ];
336
+ res.status(200);
337
+ res.setHeader("content-type", "text/event-stream");
338
+ res.setHeader("cache-control", "no-cache");
339
+ for (const event of events) {
340
+ res.write(`event: ${event.type}\ndata: ${JSON.stringify(event)}\n\n`);
341
+ }
342
+ res.end("data: [DONE]\n\n");
343
+ }
344
+
237
345
  async function main(): Promise<void> {
238
346
  scrubBlankAppInsights();
239
347
 
@@ -268,6 +376,20 @@ async function main(): Promise<void> {
268
376
  const text = typeof input.input === "string" ? input.input : null;
269
377
  res.json({ output: await router.run(text) });
270
378
  });
379
+ // The managed platform selects Foundry's Responses protocol so the agent
380
+ // can be exposed through incoming A2A. Keep this adapter small and
381
+ // deterministic: Foundry converts A2A text to Responses input, and the
382
+ // seller result becomes one assistant output_text item.
383
+ app.post("/responses", async (req, res) => {
384
+ const input = (req.body ?? {}) as Record<string, unknown>;
385
+ const output = await router.run(responsesInputText(input.input));
386
+ const response = responseEnvelope(output, typeof input.model === "string" ? input.model : APP_NAME);
387
+ if (input.stream === true) {
388
+ sendStreamingResponse(res, response);
389
+ } else {
390
+ res.json(response);
391
+ }
392
+ });
271
393
  // Required Foundry Hosted Agent health contract. The platform will not
272
394
  // create a session or forward invocations until this returns HTTP 200.
273
395
  app.get("/readiness", (_req, res) => {
@@ -280,7 +402,7 @@ async function main(): Promise<void> {
280
402
  // Foundry's documented default is 8088; PORT remains the platform override.
281
403
  const port = Number(process.env.PORT || process.env.AGENT_PORT || "8088");
282
404
  const server = app.listen(port, "0.0.0.0", () => {
283
- log.info(`Invocations host serving on 0.0.0.0:${port}`);
405
+ log.info(`Invocations + Responses host serving on 0.0.0.0:${port}`);
284
406
  });
285
407
  process.once("SIGTERM", () => {
286
408
  server.close(() => process.exit(0));
@@ -1,6 +1,6 @@
1
1
  [recipe]
2
2
  name = "runtimes/azure-foundry"
3
- description = "Runtime adapter recipe for Azure AI Foundry Hosted Agents — the second deploy target. Selected via `bag init --runtime azure-foundry`. Declares the runtime's required node deps and contributes the cloud-neutral @a2a-js/sdk server for local/dev plus the Foundry deploy host: a pass-through Invocations skill router over the SHARED SellerAgentExecutor.dispatch, serving the documented :8088 + /readiness + /invocations contract. Azure deployment currently supports A2A scaffolds only; the MCP entrypoint remains local/AgentCore-oriented and is rejected before Foundry deploy. The chain tools (tools.ts) + model factory (model.ts) are shared by both protocols (decision D9). Deploys are container-only and fully delegated to the pinned @bnbagent/deploy-cli (SDK/REST + browser login; CustomKeys secret injection; no azd/az CLIs, no azure.yaml/infra in the scaffold)."
3
+ description = "Runtime adapter recipe for Azure AI Foundry Hosted Agents — the second deploy target. Selected via `bag init --runtime azure-foundry`. Declares the runtime's required node deps and contributes the cloud-neutral @a2a-js/sdk server for local/dev plus a dual-protocol Foundry deploy host: pass-through Invocations for user-owned Azure and OpenAI Responses for managed incoming A2A, both routed over the SHARED SellerAgentExecutor.dispatch. Azure deployment currently supports A2A scaffolds only; the MCP entrypoint remains local/AgentCore-oriented and is rejected before Foundry deploy. The chain tools (tools.ts) + model factory (model.ts) are shared by both protocols (decision D9). Deploys are container-only and fully delegated to the pinned @bnbagent/deploy-cli (SDK/REST + browser login; CustomKeys secret injection; no azd/az CLIs, no azure.yaml/infra in the scaffold)."
4
4
  status = "v1"
5
5
 
6
6
  # The recipe contributes the entrypoints plus the deps below; the deploy
@@ -9,8 +9,8 @@ status = "v1"
9
9
  # azd bootstrap and no azure.yaml / infra/ in the scaffold).
10
10
  #
11
11
  # foundryMain.ts implements the documented framework-neutral container
12
- # contract directly: plain HTTP on :8088, GET /readiness, and the declared
13
- # POST /invocations pass-through route. This path was live E2E verified on
12
+ # contract directly: plain HTTP on :8088, GET /readiness, POST /invocations,
13
+ # and POST /responses (required for managed incoming A2A). The invocations path was live E2E verified on
14
14
  # 2026-07-20 through deploy, cold-start smoke, invoke, logs, and destroy.
15
15
 
16
16
  # Base deps are shared by every mode. bnbagent-deploy injects provider/storage
@@ -53,7 +53,7 @@ Treat ERC-8183 amounts as decimal strings at CLI/config boundaries and `bigint`
53
53
 
54
54
  ## CLI groups at a glance
55
55
 
56
- `init`, `scan`, `recipe`, `skills`, `wallet`, `erc8004`, `erc8183`, `x402`, `agents`, `config`, `env`, `dev`, `doctor`, `audit`, `deploy`, `platform`, `llm`, `bundle`, `budget` - see `bag --help` for details. `bag deploy [--provider bnb\|aws]` is the primary deploy command; `prepare`, `verify`, `status`, `info`, `destroy`, `logs`, and `fix-gitignore` remain lifecycle subcommands (`deploy agent` is a deprecated compatibility alias). Provider deploy/status/logs/destroy and deploy-time credential validation are delegated to pinned `@bnbagent/deploy-cli@0.4.14`.
56
+ `init`, `scan`, `recipe`, `skills`, `wallet`, `erc8004`, `erc8183`, `x402`, `agents`, `config`, `env`, `dev`, `doctor`, `audit`, `deploy`, `platform`, `llm`, `bundle`, `budget` - see `bag --help` for details. `bag deploy [--provider bnb\|aws] [--backend aws\|azure]` is the primary deploy command; `--backend` is valid only for provider `bnb` and confirms the recipe-derived managed backend. `prepare`, `verify`, `status`, `info`, `destroy`, `logs`, and `fix-gitignore` remain lifecycle subcommands (`deploy agent` is a deprecated compatibility alias). Provider deploy/status/logs/destroy and deploy-time credential validation are delegated to pinned `@bnbagent/deploy-cli@0.5.4`.
57
57
 
58
58
  ## Tool surface
59
59
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: bnbagent-studio-use-aws-agentcore
3
- description: When the user wants to deploy or operate a bnbagent-studio project on AWS Bedrock AgentCore - deploy with `bag deploy --provider aws` (all cloud lifecycle mutations are delegated to pinned `@bnbagent/deploy-cli@0.4.14`), inspect with `bag deploy status` / `logs --provider aws` / `verify --provider aws`, and tear down with `bag deploy destroy --provider aws --execute [--purge]`. Also covers AWS credential prerequisites, the optional read-only quota probe, and the runtime-secret channel.
3
+ description: When the user wants to deploy or operate a bnbagent-studio project on AWS Bedrock AgentCore - deploy with `bag deploy --provider aws` (all cloud lifecycle mutations are delegated to pinned `@bnbagent/deploy-cli@0.5.4`), inspect with `bag deploy status` / `logs --provider aws` / `verify --provider aws`, and tear down with `bag deploy destroy --provider aws --execute [--purge]`. Also covers AWS credential prerequisites, the optional read-only quota probe, and the runtime-secret channel.
4
4
  ---
5
5
 
6
6
  > **Reference file** of the `bnbagent-studio` router skill - installed at `bnbagent-studio/references/` and loaded on demand (not a standalone skill). Route here via the router's decision tree.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: bnbagent-studio-use-azure-foundry
3
- description: When the user wants to deploy or operate an A2A bnbagent-studio project on Azure AI Foundry Hosted Agents - scaffold with `bag init --runtime azure-foundry --protocols A2A`, deploy with `bag deploy --provider azure` (container-only Invocations contract; all cloud lifecycle execution is delegated to pinned `@bnbagent/deploy-cli@0.4.14`, SDK/REST with browser login - no `az`/`azd` CLIs), and run lifecycle commands with `--provider azure` when multiple deployments exist. Native MCP deploy is not supported on Azure yet; use AgentCore for MCP.
3
+ description: When the user wants to deploy or operate a bnbagent-studio project on Azure AI Foundry Hosted Agents - scaffold with `bag init --runtime azure-foundry`, deploy either to the managed platform with `bag deploy --provider bnb --backend azure` or directly with `bag deploy --provider azure`; all cloud lifecycle execution is delegated to pinned `@bnbagent/deploy-cli@0.5.4`. Native MCP is not supported on Azure; use AgentCore for MCP.
4
4
  ---
5
5
 
6
6
  > **Reference file** of the `bnbagent-studio` router skill - installed at `bnbagent-studio/references/` and loaded on demand (not a standalone skill). Route here via the router's decision tree.
@@ -9,7 +9,7 @@ description: When the user wants to deploy or operate an A2A bnbagent-studio pro
9
9
 
10
10
  > **Preview - not advertised in this release.** Azure Foundry support is fully wired but hidden from the `--runtime` menu and the deploy provider menu; these steps still work if you select `azure-foundry` / `--provider azure` explicitly. The most recent end-to-end live verification predates the TypeScript rewrite - treat your first deploy as a verification run.
11
11
 
12
- Procedure for deploying and operating the seller Agent on **Azure AI Foundry Hosted Agents** (`[stack].runtime = "azure-foundry"`). ALL cloud execution - browser login, Foundry onboarding, the container registry image build/push, secret provisioning, and the RBAC self-grant - is **delegated to the pinned `@bnbagent/deploy-cli`** (run via `bunx --bun`; override with `BNBAGENT_DEPLOY_COMMAND`), whose Azure provider is **SDK/REST-only**. Studio never shells out to (or requires) the `az` / `azd` CLIs.
12
+ Procedure for deploying and operating the seller Agent on **Azure AI Foundry Hosted Agents** (`[stack].runtime = "azure-foundry"`). ALL cloud execution is **delegated to the pinned `@bnbagent/deploy-cli`** (run via `bunx --bun`; override with `BNBAGENT_DEPLOY_COMMAND`), whose Azure provider is **SDK/REST-only**. Studio never shells out to (or requires) the `az` / `azd` CLIs. Direct user-owned deployment uses browser/local credentials and may self-heal RBAC; the managed platform uses environment credentials in `ambient-only` mode and only probes RBAC.
13
13
 
14
14
  ```
15
15
  <workspace>/
@@ -21,7 +21,7 @@ Procedure for deploying and operating the seller Agent on **Azure AI Foundry Hos
21
21
 
22
22
  > **Deploy model: CONTAINER-ONLY.** The deploy-cli Azure provider rejects Node zip artifacts, so every azure-foundry deploy builds the scaffolded `app/agent/Dockerfile` **locally with Docker** (linux/amd64) and pushes it to the auto-provisioned Azure Container Registry; Foundry Agent Service pulls and runs the image. A running Docker daemon is required.
23
23
 
24
- > **Protocol: A2A projects only for now.** The deployed Node host speaks Foundry's pass-through Invocations container contract on `:8088` (`GET /readiness`, `POST /invocations`). That endpoint is not native MCP streamable HTTP; `bag init` and provider selection reject azure-foundry + MCP instead of deploying a container that can never become ready.
24
+ > **Protocol: A2A projects only for now.** The deployed Node host speaks both Foundry container contracts on `:8088`: `GET /readiness`, pass-through `POST /invocations` for user-owned Azure, and OpenAI-compatible `POST /responses` for managed incoming A2A. Neither endpoint is native MCP streamable HTTP; `bag init` and provider selection reject azure-foundry + MCP instead of deploying a container that can never become ready.
25
25
 
26
26
  > **Auth is a browser login.** The first delegated run opens a browser to sign in to the right tenant/subscription - there is no `az login` / `azd auth login` step and no CLI to install.
27
27
 
@@ -38,7 +38,7 @@ Procedure for deploying and operating the seller Agent on **Azure AI Foundry Hos
38
38
  - **Region must support Hosted Agents.** Default `eastus2`. `eastus` does NOT. Prepare refuses an unsupported `[azure].location` (else deploy fails with `Unsupported region for Foundry Hosted Agents`).
39
39
  - **Account name MUST equal the custom subdomain.** The runtime derives `https://{account_name}.services.ai.azure.com`; a mismatch resolves to NXDOMAIN and the agent returns HTTP 500. `bag init` sets them equal - keep them equal in `[azure]`.
40
40
  - **Empty `APPLICATIONINSIGHTS_CONNECTION_STRING` crashes the exporter.** The emitted entrypoint drops it when blank - don't remove that guard.
41
- - **The hosted container contract is fixed.** Keep `AGENT_PORT=8088`, `GET /readiness` returning HTTP 200, and `POST /invocations`. Local A2A still runs on `:9000`; do not copy that local port into the Foundry Dockerfile.
41
+ - **The hosted container contract is fixed.** Keep `AGENT_PORT=8088`, `GET /readiness` returning HTTP 200, and both `POST /invocations` and `POST /responses`. Local A2A still runs on `:9000`; do not copy that local port into the Foundry Dockerfile.
42
42
  - **Prepare checks are local-only.** They validate the scaffold (region, subdomain, entrypoint + Dockerfile, an OpenAI-compatible `[llm]` provider, twak readiness) without any cloud call; Azure auth happens at deploy time.
43
43
 
44
44
  ## Runtime secrets - the delegated hand-off
@@ -47,7 +47,7 @@ Procedure for deploying and operating the seller Agent on **Azure AI Foundry Hos
47
47
 
48
48
  > The encrypted keystore (`.studio/wallets/`) stays at the workspace root and rides only that secret channel - never baked into the image.
49
49
 
50
- Provider-native overrides go in the optional `studio.toml [deploy.foundry]` table (verbatim deploy-spec keys; deploy-cli 0.4.14 consumes `account`, `cpu`, `location`, `memory`, `project`, `projectEndpoint`, `protocol`, `registry` and warns about anything else). The `[azure]` block's `account_name` / `project_name` / `project_endpoint` / `location` win over conflicting `[deploy.foundry]` keys.
50
+ Provider-native overrides go in the optional `studio.toml [deploy.foundry]` table (verbatim deploy-spec keys; deploy-cli 0.5.4 consumes `account`, `cpu`, `location`, `memory`, `project`, `projectEndpoint`, `protocol`, `registry` and warns about anything else). The `[azure]` block's `account_name` / `project_name` / `project_endpoint` / `location` win over conflicting `[deploy.foundry]` keys.
51
51
 
52
52
  ## Typical workflow
53
53
 
@@ -76,9 +76,17 @@ bag deploy --provider azure # delegated: login → onboard →
76
76
 
77
77
  ```bash
78
78
  bag deploy status # all recorded providers + live state
79
+ bag deploy info --with-curl # endpoint + Entra token shortcut + request body
79
80
  bag deploy logs --provider azure --limit 50 # delegated Hosted Agent logs
80
81
  ```
81
82
 
83
+ `bag deploy info` reads the recorded Azure endpoint without recreating the
84
+ temporary deploy spec. `--with-curl` adds an optional `az account
85
+ get-access-token --resource https://ai.azure.com` shortcut and a complete
86
+ Invocations request. This does not make the Azure CLI a deploy prerequisite;
87
+ application clients may mint the same `https://ai.azure.com/.default` scope
88
+ with `DefaultAzureCredential` or `ClientSecretCredential`.
89
+
82
90
  The built-in smoke proves the container contract, not the seller signature. For a release E2E, invoke with a complete `negotiate` envelope and require `response.accepted=true`, a non-empty `negotiation_hash`, and `provider_sig`. The Invocations body is `{"input":"<serialized skill JSON>"}`.
83
91
 
84
92
  ### D. Tear down
@@ -9,7 +9,7 @@ description: Use when deploying or operating a bnbagent-studio seller on the BNB
9
9
 
10
10
  Treat this provider as a temporary testnet sandbox. Require a throwaway wallet, keep `bsc-testnet`, and explain that the runtime signing material is transmitted to the operator's managed secret store for the trial. Never use a mainnet key. Exception: `wallet.kind='altana'` ships only the bounded, budget-limited, revocable session - the throwaway-wallet advice does not apply; tighten the session instead (`bag wallet session grant --force --budget-u <small> --expiry-days <short>`) and never run `bag wallet new` on an altana project (it breaks the session's `[wallet].address` anchor).
11
11
 
12
- All auth and cloud lifecycle work must cross the pinned `@bnbagent/deploy-cli@0.4.14` boundary. Do not call the AWS CLI or platform REST routes directly.
12
+ All auth and cloud lifecycle work must cross the pinned `@bnbagent/deploy-cli@0.5.4` boundary. Do not call a cloud CLI or platform REST routes directly. The managed backend is recipe-derived: `agentcore` uses AWS; `azure-foundry` uses Azure. For headless managed Azure, confirm with `bag deploy --provider bnb --backend azure --yes`; never treat `--backend` as a cross-cloud recipe converter.
13
13
 
14
14
  ## Select and authenticate
15
15