@bnbagent/studio-cli 0.0.8-alpha.1 → 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/_agentcoreName-DZDWEYD3.js +0 -0
- package/dist/_twak-4XF4H5PL.js +0 -0
- package/dist/bag.js +229 -29
- package/dist/chunk-RO726HJG.js +0 -0
- package/dist/chunk-U7IDQ3K5.js +0 -0
- package/dist/{chunk-ODCZKKZJ.js → chunk-YFEM4564.js} +7 -2
- package/dist/{deployCli-VM5TYKQX.js → deployCli-NJFCWBSF.js} +1 -1
- package/package.json +12 -11
- package/recipes/runtimes/azure-foundry/code/{{PKG}}/foundryMain.ts.tmpl +125 -3
- package/recipes/runtimes/azure-foundry/recipe.toml +3 -3
- package/skills/bnbagent-studio.md +1 -1
- package/skills/references/bnbagent-studio-use-aws-agentcore.md +1 -1
- package/skills/references/bnbagent-studio-use-azure-foundry.md +13 -5
- package/skills/references/bnbagent-studio-use-bnb-trial.md +1 -1
- package/LICENSE +0 -201
|
File without changes
|
package/dist/_twak-4XF4H5PL.js
CHANGED
|
File without changes
|
package/dist/bag.js
CHANGED
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
x402SellerIsFree,
|
|
45
45
|
x402SellerPricingState,
|
|
46
46
|
x402SellerUsesB402
|
|
47
|
-
} from "./chunk-
|
|
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-
|
|
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
|
-
|
|
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,
|
|
13429
|
-
if (platformArtifact(loadAgent(root)) !== "container")
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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()).
|
|
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(
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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 (
|
|
16774
|
+
if (opts.limit) {
|
|
16575
16775
|
argv.push("--limit", opts.limit);
|
|
16576
16776
|
}
|
|
16577
|
-
if (
|
|
16777
|
+
if (opts.session) {
|
|
16578
16778
|
argv.push("--session", opts.session);
|
|
16579
16779
|
}
|
|
16580
16780
|
return runDeployCliStream(argv, {
|
|
@@ -20842,7 +21042,7 @@ function buildProgram() {
|
|
|
20842
21042
|
return program;
|
|
20843
21043
|
}
|
|
20844
21044
|
function cliVersion() {
|
|
20845
|
-
return "0.0.8
|
|
21045
|
+
return "0.0.8";
|
|
20846
21046
|
}
|
|
20847
21047
|
|
|
20848
21048
|
// src/cli/updateCheck.ts
|
package/dist/chunk-RO726HJG.js
CHANGED
|
File without changes
|
package/dist/chunk-U7IDQ3K5.js
CHANGED
|
File without changes
|
|
@@ -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
|
|
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
|
-
|
|
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);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bnbagent/studio-cli",
|
|
3
|
-
"version": "0.0.
|
|
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",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"directory": "packages/studio-cli"
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
|
+
"packageManager": "pnpm@10.24.0",
|
|
28
29
|
"engines": {
|
|
29
30
|
"node": ">=22"
|
|
30
31
|
},
|
|
@@ -41,8 +42,16 @@
|
|
|
41
42
|
"bin": {
|
|
42
43
|
"bag": "./dist/bag.js"
|
|
43
44
|
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "tsup",
|
|
47
|
+
"test": "vitest run",
|
|
48
|
+
"lint": "biome check src tests",
|
|
49
|
+
"typecheck": "tsc --noEmit",
|
|
50
|
+
"check": "pnpm typecheck && pnpm lint && pnpm test && pnpm build"
|
|
51
|
+
},
|
|
44
52
|
"dependencies": {
|
|
45
53
|
"@bnbagent/sdk": "0.5.0",
|
|
54
|
+
"@bnbagent/studio-runtime": "0.0.9",
|
|
46
55
|
"ai": "^7.0.29",
|
|
47
56
|
"archiver": "^8.0.0",
|
|
48
57
|
"commander": "^15.0.0",
|
|
@@ -53,8 +62,7 @@
|
|
|
53
62
|
"smol-toml": "^1.3.0",
|
|
54
63
|
"tar": "^7.4.0",
|
|
55
64
|
"viem": "^2.54.0",
|
|
56
|
-
"yaml": "^2.9.0"
|
|
57
|
-
"@bnbagent/studio-runtime": "0.0.8-alpha.1"
|
|
65
|
+
"yaml": "^2.9.0"
|
|
58
66
|
},
|
|
59
67
|
"devDependencies": {
|
|
60
68
|
"@a2a-js/sdk": "^0.3.14",
|
|
@@ -70,12 +78,5 @@
|
|
|
70
78
|
"typescript": "^5.5.0",
|
|
71
79
|
"vitest": "^2.0.0",
|
|
72
80
|
"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"
|
|
80
81
|
}
|
|
81
|
-
}
|
|
82
|
+
}
|
|
@@ -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
|
|
8
|
-
*
|
|
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
|
|
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,
|
|
13
|
-
# POST /
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
package/LICENSE
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
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.
|