@bnbagent/studio-cli 0.0.13-alpha.2 → 0.0.13-alpha.3

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.
Files changed (25) hide show
  1. package/README.md +34 -6
  2. package/dist/bag.js +1571 -335
  3. package/dist/{chunk-XCKI45TP.js → chunk-E4C75NSV.js} +139 -43
  4. package/dist/{deployCli-HZNZU3CN.js → deployCli-UOUCOIW5.js} +1 -1
  5. package/package.json +4 -3
  6. package/recipes/agent/recipe.toml +1 -1
  7. package/recipes/mpp-buyer/code/{{PKG}}/mppBuyer.ts.tmpl +113 -0
  8. package/recipes/mpp-buyer/recipe.toml +15 -0
  9. package/recipes/runtimes/agentcore/code/{{PKG}}/dualMain.ts.tmpl +13 -12
  10. package/recipes/runtimes/agentcore/code/{{PKG}}/mcpMain.ts.tmpl +10 -9
  11. package/recipes/runtimes/agentcore/code/{{PKG}}/unifiedMain.ts.tmpl +16 -15
  12. package/recipes/runtimes/agentcore/recipe.toml +1 -1
  13. package/recipes/runtimes/azure-foundry/code/{{PKG}}/mcpMain.ts.tmpl +10 -9
  14. package/recipes/runtimes/azure-foundry/code/{{PKG}}/unifiedMain.ts.tmpl +16 -15
  15. package/recipes/runtimes/azure-foundry/recipe.toml +1 -1
  16. package/recipes/x402-buyer/recipe.toml +1 -1
  17. package/skills/bnbagent-studio.md +5 -4
  18. package/skills/references/bnbagent-studio-buying-via-8183.md +2 -2
  19. package/skills/references/bnbagent-studio-buying-via-mpp.md +44 -0
  20. package/skills/references/bnbagent-studio-scaffolding-agent.md +9 -5
  21. package/skills/references/bnbagent-studio-selling-via-8183.md +1 -1
  22. package/skills/references/bnbagent-studio-selling-via-b402.md +1 -1
  23. package/skills/references/bnbagent-studio-use-aws-agentcore.md +1 -1
  24. package/skills/references/bnbagent-studio-use-azure-foundry.md +44 -14
  25. package/skills/references/bnbagent-studio-use-bnb-trial.md +10 -3
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: bnbagent-studio-use-azure-foundry
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.13`. Native MCP is not supported on Azure; 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.15`. 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.
@@ -16,14 +16,14 @@ Procedure for deploying and operating the seller Agent on **Azure AI Foundry Hos
16
16
  ```
17
17
  <workspace>/
18
18
  ├── app/agent/ # the deployed code (src/unifiedMain.ts host + Dockerfile here)
19
- │ ├── studio.toml # [azure] block: location / subscription_id / account_name / subdomain / project_name / agent_endpoint
19
+ │ ├── studio.toml # [azure] resources plus named HTTP/A2A/Invocations endpoint records
20
20
  │ └── Dockerfile # the container image bnbagent-deploy builds + pushes
21
21
  └── .studio/ # secrets + wallets (workspace root - never in the image)
22
22
  ```
23
23
 
24
24
  > **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.
25
25
 
26
- > **Protocol:** A2A, X402-only, and A2A+X402 projects are supported. 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.
26
+ > **Protocol:** A2A, X402-only, and A2A+X402 projects are supported. The deployed Node host speaks both Foundry container contracts on `:8088`: `GET /readiness`, pass-through `POST /invocations`, and OpenAI-compatible `POST /responses`; new direct A2A deploys also enable native incoming A2A. None of these endpoints is native MCP streamable HTTP, so `bag init` and provider selection reject azure-foundry + MCP.
27
27
 
28
28
  > **Auth is explicit.** User-owned Azure needs a saved delegated browser sign-in, or an ambient Azure credential chain in CI. Deployment itself never shells out to `az` or `azd`, and a non-interactive deploy cannot open a browser.
29
29
 
@@ -31,7 +31,7 @@ Procedure for deploying and operating the seller Agent on **Azure AI Foundry Hos
31
31
 
32
32
  1. **Bun 1.3+ (`bunx`) on PATH** - the pinned `@bnbagent/deploy-cli` runs through it.
33
33
  2. **Docker running** - the image is built locally (linux/amd64) before push.
34
- 3. **An Azure subscription** the operator may provision in (Foundry account/project, container registry, hosted agent). Before a local self-deploy, run `bunx --bun @bnbagent/deploy-cli@0.5.13 login --provider azure`; use OIDC/service-principal credentials in CI.
34
+ 3. **An Azure subscription** the operator may provision in (Foundry account/project, container registry, hosted agent). Before a local self-deploy, run `bunx --bun @bnbagent/deploy-cli@0.5.15 login --provider azure`; use OIDC/service-principal credentials in CI.
35
35
 
36
36
  ## ⚠️ Foundry gotchas (read before deploying)
37
37
 
@@ -49,7 +49,7 @@ Procedure for deploying and operating the seller Agent on **Azure AI Foundry Hos
49
49
 
50
50
  > The encrypted keystore (`.studio/wallets/`) stays at the workspace root and rides only that secret channel - never baked into the image.
51
51
 
52
- Provider-native overrides go in the optional `studio.toml [deploy.foundry]` table (verbatim deploy-spec keys; deploy-cli 0.5.13 consumes `account`, `cpu`, `location`, `memory`, `project`, `projectEndpoint`, `protocol`, `registry`, `subscriptionId` and warns about anything else). The `[azure]` block's `subscription_id` / `account_name` / `project_name` / `project_endpoint` / `location` win over conflicting `[deploy.foundry]` keys.
52
+ Provider-native overrides go in the optional `studio.toml [deploy.foundry]` table (verbatim deploy-spec keys; deploy-cli 0.5.14 consumes `account`, `cpu`, `incomingA2a`, `agentCard`, `location`, `memory`, `project`, `projectEndpoint`, `protocol`, `rawInvocations`, `registry`, and `subscriptionId`, and warns about anything else). The `[azure]` block's `subscription_id` / `account_name` / `project_name` / `project_endpoint` / `location` win over conflicting `[deploy.foundry]` keys.
53
53
 
54
54
  ## Typical workflow
55
55
 
@@ -72,7 +72,13 @@ bag deploy prepare --runtime azure-foundry # local readiness gate (region/subd
72
72
  bag deploy --provider azure # delegated: onboard → build+push → CustomKeys → deploy [--smoke]
73
73
  ```
74
74
 
75
- `bag deploy --provider azure` runs an HTTP contract smoke by default (pass `--skip-smoke` to omit it) and captures the Foundry endpoint into `app/agent/studio.toml [azure].agent_endpoint`. If Foundry creates the resource but that post-create check fails, Studio still records the discovered endpoint so `status`, `logs`, and `destroy` can manage the resource; the deploy command continues to return non-zero.
75
+ `bag deploy --provider azure` runs an HTTP contract smoke by default (pass `--skip-smoke` to omit it), enables incoming A2A, and captures `[azure].http_endpoint`, `a2a_endpoint`, and `agent_card_endpoint`. When X402 is selected it also declares and records `[azure].invocations_endpoint` for the operator's authenticated envelope tunnel. `[azure].agent_endpoint` remains the compatibility primary and points to A2A for new deployments. If Foundry creates the resource but a post-create check fails, Studio still records discovered endpoints so `status`, `logs`, and `destroy` can manage it; the deploy command continues to return non-zero.
76
+
77
+ For a first deploy in non-interactive automation, pass `--yes`. Studio treats
78
+ that as confirmation of the full deployment plan and delegates explicit
79
+ Foundry project onboarding. Configure `[azure].subscription_id` and
80
+ `account_name` when several candidates are accessible so no prompt or guess is
81
+ required.
76
82
 
77
83
  For a first deploy in non-interactive automation, pass `--yes`. Studio treats
78
84
  that as confirmation of the full deployment plan and delegates explicit
@@ -88,10 +94,7 @@ bag deploy info --provider azure --with-curl # endpoint + Entra token shortcut +
88
94
  bag deploy logs --provider azure --limit 50 # delegated Hosted Agent logs
89
95
  ```
90
96
 
91
- `bag deploy info --provider azure` reads the recorded Azure endpoint without recreating the
92
- temporary deploy spec. `--with-curl` adds an optional `az account
93
- get-access-token --resource https://ai.azure.com` shortcut and a complete
94
- Invocations request. This does not make the Azure CLI a deploy prerequisite;
97
+ `bag deploy info` reads the recorded named Azure endpoints without recreating the temporary deploy spec. `--with-curl` adds an optional `az account get-access-token --resource https://ai.azure.com` shortcut and complete Responses HTTP, Agent Card, and A2A requests. This does not make the Azure CLI a deploy prerequisite;
95
98
  application clients may mint the same `https://ai.azure.com/.default` scope
96
99
  with `DefaultAzureCredential` or `ClientSecretCredential`.
97
100
 
@@ -102,7 +105,34 @@ session, logs lists the recent sessions visible to the current Azure identity.
102
105
  Foundry scopes that list by identity/isolation key, so an external buyer or
103
106
  gateway must still preserve the session header from its own response.
104
107
 
105
- 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>"}`.
108
+ The built-in smoke proves the container contract, not the seller signature. For a release E2E, POST A2A JSON-RPC `message/send` to the recorded A2A endpoint with `A2A-Version: 1.0`, or use the Responses/Invocations contract selected for the deployment. Require `response.accepted=true`, a non-empty `negotiation_hash`, and `provider_sig`.
109
+
110
+ ### X402 external gateway
111
+
112
+ Foundry does not expose a raw anonymous `/x402` URL. An operator-run HTTPS
113
+ gateway authenticates to the recorded Invocations endpoint with an Entra token
114
+ for `https://ai.azure.com/.default`, wraps the incoming HTTP request as
115
+ `http-envelope-v1`, and unwraps the returned inner status, headers, and base64
116
+ body:
117
+
118
+ ```json
119
+ {
120
+ "v": 1,
121
+ "method": "POST",
122
+ "path": "/x402",
123
+ "query": {},
124
+ "headers": { "content-type": "application/json" },
125
+ "body": "<base64-encoded request body>"
126
+ }
127
+ ```
128
+
129
+ `bag deploy info --provider azure --json` reports the deployed face snapshot,
130
+ seller state, carrier contract, and a request example. In FREE mode that
131
+ example executes seller work without a payment; in PAID mode it returns the
132
+ inner 402 before work until a valid payment is supplied. A PAID seller also
133
+ needs fixed facilitator egress; use an Azure Container Apps workload-profiles
134
+ environment with VNet integration and a NAT Gateway static IP, then allowlist
135
+ that IP with B402. Studio does not deploy or manage the gateway or network.
106
136
 
107
137
  ### X402 external gateway
108
138
 
@@ -148,8 +178,8 @@ a registry proven to be owned by bnbagent-deploy. External registry overrides,
148
178
  untagged registries, and registries shared by another Foundry project are kept.
149
179
  `--purge` also removes the retained resources the deploy record tracks -
150
180
  including the soft-deleted Cognitive Services account, freeing the custom
151
- subdomain immediately (otherwise held ~48h). A successful teardown clears the
152
- recorded `[azure].agent_endpoint`.
181
+ subdomain immediately (otherwise held ~48h). A successful teardown clears all
182
+ recorded `[azure]` endpoints.
153
183
 
154
184
  ## Scope note
155
185
 
@@ -158,6 +188,6 @@ Azure Foundry is an alternate runtime for the whole seller agent. There is no se
158
188
  ## Reference
159
189
 
160
190
  - `bag deploy --help` / `bag deploy <command> --help` (authoritative for commands + flags)
161
- - `app/agent/studio.toml [azure]` - location / subscription_id / account_name / subdomain / project_name / agent_endpoint
191
+ - `app/agent/studio.toml [azure]` - resource configuration plus `http_endpoint` / `invocations_endpoint` / `a2a_endpoint` / `agent_card_endpoint`
162
192
  - `app/agent/studio.toml [deploy.foundry]` - provider-native deploy-spec passthrough
163
193
  - `BNBAGENT_DEPLOY_COMMAND` - override the pinned `bunx --bun @bnbagent/deploy-cli@<pin>` invocation (E2E/dev)
@@ -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.5.13` 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.
12
+ All auth and cloud lifecycle work must cross the pinned `@bnbagent/deploy-cli@0.5.15` 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
 
@@ -18,9 +18,16 @@ Run:
18
18
  ```bash
19
19
  bag platform login
20
20
  bag platform credit
21
+ bag deploy prepare --provider bnb --backend aws
21
22
  bag deploy --provider bnb
22
23
  ```
23
24
 
25
+ For an `azure-foundry` recipe, use
26
+ `bag deploy prepare --provider bnb --backend azure` followed by
27
+ `bag deploy --provider bnb --backend azure --yes`. The explicit Platform
28
+ prepare target must accept `[storage].kind='local'`: the API supplies managed
29
+ S3/Blob storage and Studio must not require or forward BYOS credentials.
30
+
24
31
  `bag platform login` must print the GitHub verification URL and device code. It must not open a browser. Give both values to the user and wait for them to complete verification.
25
32
 
26
33
  Before offering BNB, inspect the trial result:
@@ -46,14 +53,14 @@ bag deploy destroy --provider bnb --execute # destructive confirmation
46
53
 
47
54
  `status` lists every recorded provider and includes the live trial countdown. Use `--no-probe` only when local records are desired. With multiple deployments, logs/verify/destroy must select a provider interactively or pass `--provider`.
48
55
 
49
- Destroy clears only the BNB lifecycle record after the delegated delete succeeds. It does not delete the local keystore or the on-chain ERC-8004 identity. Destroyed BNB slugs are retired; choose a fresh slug before redeploy.
56
+ Destroy clears the BNB lifecycle record after the delegated delete succeeds. The Agent's managed deliverables share that lifecycle: deletion removes them and their `bnbagent-api` URLs eventually return 404. It does not delete the local keystore or the on-chain ERC-8004 identity. Destroyed BNB slugs are retired; choose a fresh slug before redeploy.
50
57
 
51
58
  ## Manual staging verification
52
59
 
53
60
  Use the staging endpoint only for the current shell:
54
61
 
55
62
  ```bash
56
- export BNBAGENT_API_URL=https://bnbagent-api.fe.kfkshore.org
63
+ export BNBAGENT_API_URL=https://bnbagent-api-staging.bnbchain.world
57
64
  bag platform login
58
65
  bag platform credit
59
66
  bag deploy --provider bnb