@bnbagent/studio-cli 0.0.6-alpha.6 → 0.0.6-alpha.8
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/DISCLAIMER.md +6 -27
- package/README.md +6 -13
- package/dist/bag.js +1121 -795
- package/dist/{chunk-VEOOFDSF.js → chunk-JZAW6HMV.js} +74 -5
- package/dist/{deployCli-EEK75T67.js → deployCli-AJ25A4VK.js} +1 -1
- package/package.json +2 -2
- package/recipes/providers/pieverse-llm/skills/funding-pieverse-llm.md +32 -64
- package/skills/bnbagent-studio.md +29 -74
- package/skills/references/bnbagent-studio-adding-to-project.md +58 -169
- package/skills/references/bnbagent-studio-buying-from-bazaar.md +43 -104
- package/skills/references/bnbagent-studio-buying-via-8183.md +38 -112
- package/skills/references/bnbagent-studio-extending-signing.md +47 -50
- package/skills/references/bnbagent-studio-operating.md +58 -111
- package/skills/references/bnbagent-studio-scaffolding-agent.md +136 -403
- package/skills/references/bnbagent-studio-selling-via-8183.md +87 -172
- package/skills/references/bnbagent-studio-selling-via-b402.md +39 -131
- package/skills/references/bnbagent-studio-use-aws-agentcore.md +43 -144
- package/skills/references/bnbagent-studio-use-azure-foundry.md +34 -95
- package/skills/references/bnbagent-studio-use-bnb-trial.md +12 -36
- package/skills/references/bnbagent-studio-using-altana-wallet.md +11 -28
- package/skills/references/bnbagent-studio-using-twak-wallet.md +102 -210
- package/skills/references/bnbagent-studio-wiring-llm-tools.md +71 -150
|
@@ -1,101 +1,79 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: bnbagent-studio-operating
|
|
3
|
-
description: When the user wants to run, debug, diagnose, or operate a bnbagent-studio agent project. Covers dev server, doctor checks, balance/RPC queries, job status reads, and incident triage
|
|
3
|
+
description: When the user wants to run, debug, diagnose, or operate a bnbagent-studio agent project. Covers dev server, doctor checks, balance/RPC queries, job status reads, and incident triage - including the delegated deploy lifecycle (`bag deploy status` / `logs` / `verify` / `destroy`), twak-wallet issues, and `PolicyViolation` / `X402PolicyError` signing-policy errors (deep-dive playbooks for those ship as references of the `bnbagent-studio` router skill; read them on demand).
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
> **Reference file** of the `bnbagent-studio` router skill
|
|
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.
|
|
7
7
|
|
|
8
8
|
# bnbagent-studio-operating
|
|
9
9
|
|
|
10
|
-
Procedure for **day-to-day operation** of an existing bnbagent-studio project.
|
|
11
|
-
Audience: Claude Code in a v0.0.1 workspace (thin root with the `agentcore/`
|
|
12
|
-
config dir + the workspace-root `.studio/wallets/` + funded wallet, plus the
|
|
13
|
-
single sub-project `app/agent/` holding `studio.toml` + `src/main.ts` /
|
|
14
|
-
`src/sellerCore.ts` / `src/executor.ts` / `src/agentCard.ts` /
|
|
15
|
-
`src/signing.ts`). Most commands run from the workspace root; the v0.0.1
|
|
16
|
-
project-root fallback locates the `app/agent/` sub-project automatically for
|
|
17
|
-
wallet/LLM/budget ops.
|
|
10
|
+
Procedure for **day-to-day operation** of an existing bnbagent-studio project. Audience: Claude Code in a current TypeScript workspace (thin root with the `agentcore/` config dir + the workspace-root `.studio/wallets/` + funded wallet, plus the single sub-project `app/agent/` holding `studio.toml` + `src/main.ts` / `src/sellerCore.ts` / `src/executor.ts` / `src/agentCard.ts` / `src/signing.ts`). Most commands run from the workspace root; the current project-root fallback locates the `app/agent/` sub-project automatically for wallet/LLM/budget ops.
|
|
18
11
|
|
|
19
12
|
**Different from**:
|
|
20
|
-
|
|
21
|
-
- `bnbagent-studio-
|
|
22
|
-
- `
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
directory (Claude Code: `~/.claude/skills/bnbagent-studio/references/`; Cursor:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- `bnbagent-studio-use-
|
|
29
|
-
- `bnbagent-studio-
|
|
30
|
-
- `bnbagent-studio-
|
|
31
|
-
- `bnbagent-studio-
|
|
32
|
-
- `bnbagent-studio-
|
|
33
|
-
- `bnbagent-studio-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
This playbook covers **generic ops**: dev / doctor / balances / RPC / incident triage.
|
|
37
|
-
For seller job-lifecycle decisions (settle / submit / dispute defense), read
|
|
38
|
-
`bnbagent-studio-selling-via-8183.md` (same directory); for the buyer side, read the buying reference.
|
|
13
|
+
|
|
14
|
+
- `bnbagent-studio-scaffolding-agent.md` (in this same references/ directory) - creates a brand new project
|
|
15
|
+
- `bnbagent-studio-selling-via-8183.md` (in this same references/ directory) - seller flow (`runWork` value, rule-based quote pricing, dispute defense)
|
|
16
|
+
- `funding-pieverse-llm` (project-scope skill, Pieverse projects only) - Pieverse credit lifecycle / topup decisions
|
|
17
|
+
|
|
18
|
+
**Deep-dive references** - plain markdown files in this SAME references/ directory (Claude Code: `~/.claude/skills/bnbagent-studio/references/`; Cursor: `bnbagent-studio/references/` beside the `.mdc` rules). READ the file when the topic comes up - don't answer from memory:
|
|
19
|
+
|
|
20
|
+
- `bnbagent-studio-use-aws-agentcore.md` - the delegated AgentCore lifecycle (`bag deploy --provider aws` / `status` / `logs` / `verify` / `destroy`) + AWS prerequisites
|
|
21
|
+
- `bnbagent-studio-use-bnb-trial.md` - GitHub device login, 48h eligibility, staging verification, and the delegated BNB trial lifecycle
|
|
22
|
+
- `bnbagent-studio-using-twak-wallet.md` - `[wallet].kind = "twak"` create / fund / SIWE-bind / container deploy / limitations
|
|
23
|
+
- `bnbagent-studio-extending-signing.md` - `PolicyViolation` / `X402PolicyError` diagnosis + extending the EIP-712 allowlist
|
|
24
|
+
- `bnbagent-studio-adding-to-project.md` - adding the seller runtime to an existing TypeScript project
|
|
25
|
+
- `bnbagent-studio-buying-via-8183.md` - buyer flow (find provider → buy → fetch → settle)
|
|
26
|
+
- `bnbagent-studio-selling-via-b402.md` - inbound x402 pricing mode, paid merchant setup, and B402 settlement operations
|
|
27
|
+
|
|
28
|
+
This playbook covers **generic ops**: dev / doctor / balances / RPC / incident triage. For seller job-lifecycle decisions (submit and dispute defense), read `bnbagent-studio-selling-via-8183.md` (same directory); for buyer settlement, read the buying reference.
|
|
39
29
|
|
|
40
30
|
## Quick triage decision tree
|
|
41
31
|
|
|
42
32
|
| User said... | Run first |
|
|
43
|
-
|
|
33
|
+
| --- | --- |
|
|
44
34
|
| "is it healthy?" / "doctor" | `bag doctor` (scans the `app/agent/` sub-project from the workspace root) |
|
|
45
|
-
| "run locally" / "start it" / "dev" | `bag dev` (serves the selected protocol: A2A on `:9000`, MCP on `:8000/mcp`
|
|
46
|
-
| "what's my balance?" / "how much U?" | `bag wallet balance` (native + U; `--network X` / `--all` available
|
|
47
|
-
| "send X tBNB / U to another address" |
|
|
48
|
-
| "approve commerce contract to spend U" |
|
|
49
|
-
| "how much have I approved 0x... for?" |
|
|
50
|
-
| "is my agent registered?" | `bag erc8004 show` (note: registration is normally automatic at `bag deploy verify`
|
|
51
|
-
| "what's the status of job X?" | `bag erc8183 status <id>` (read-only
|
|
35
|
+
| "run locally" / "start it" / "dev" | `bag dev` (serves the selected protocol: A2A on `:9000`, MCP on `:8000/mcp` - same for any destination) |
|
|
36
|
+
| "what's my balance?" / "how much U?" | `bag wallet balance` (native + U; `--network X` / `--all` available; `--address X` is not implemented) |
|
|
37
|
+
| "send X tBNB / U to another address" | `bag wallet transfer` is not implemented; move funds with an external wallet |
|
|
38
|
+
| "approve commerce contract to spend U" | The `bag erc20` group is not implemented (funding flows auto-approve U; there is no manual approve CLI) |
|
|
39
|
+
| "how much have I approved 0x... for?" | `bag erc20 allowance` is not implemented |
|
|
40
|
+
| "is my agent registered?" | `bag erc8004 show` (note: registration is normally automatic at `bag deploy verify` - manual `bag erc8004 register` only if you need an identity before deploy) |
|
|
41
|
+
| "what's the status of job X?" | `bag erc8183 status <id>` (read-only - neutral) |
|
|
52
42
|
| "is `/x402` paid or free?" | `bag x402 sell status` (`Rail state: paid` probes B402 unless `--no-probe`; `free` skips B402) |
|
|
53
|
-
| "settle job X" | `bag erc8183 settle <id> --action approve\|reject\|dispute` (default `approve`)
|
|
54
|
-
| "submit work for job X" | **seller action**
|
|
43
|
+
| "settle job X" | `bag erc8183 settle <id> --action approve\|reject\|dispute` (default `approve`) is a buyer or quorum action; read `bnbagent-studio-buying-via-8183.md` for timing and authority |
|
|
44
|
+
| "submit work for job X" | **seller action** - read `bnbagent-studio-selling-via-8183.md` (same directory) for the submit/dispute flow |
|
|
55
45
|
| "tx not confirming" | Read BscScan link from prior tx output + check `eth_getTransactionCount` |
|
|
56
46
|
| "wallet balance is wrong" | Check both tBNB (gas) and U (token); see balance section |
|
|
57
47
|
| "is it deployed?" / "deploy status" | `bag deploy status` lists every locally recorded BNB/AWS deployment and asks `bnbagent-deploy` for live state; add `--no-probe` for record-only output |
|
|
58
|
-
| "deploy logs" / "verify" / "tear it down" | With one recorded deployment, `bag deploy {logs,verify,destroy}` selects it automatically. With multiple, choose interactively or pass `--provider bnb\|aws` in automation.
|
|
48
|
+
| "deploy logs" / "verify" / "tear it down" | With one recorded deployment, `bag deploy {logs,verify,destroy}` selects it automatically. With multiple, choose interactively or pass `--provider bnb\|aws` in automation. Provider lifecycle and status/log calls go through `bnbagent-deploy`; ERC-8004 reconciliation remains a Studio chain operation. `bag platform credit` shows the BNB trial countdown. |
|
|
59
49
|
|
|
60
50
|
## Common ops procedures
|
|
61
51
|
|
|
62
52
|
### A. Run the agent locally (the default)
|
|
63
53
|
|
|
64
54
|
```bash
|
|
65
|
-
# Configure secrets (idempotent
|
|
55
|
+
# Configure secrets (idempotent - does NOT duplicate existing keys).
|
|
66
56
|
# These write into .studio/.env.local (the Agent's secrets):
|
|
67
57
|
# Edit .studio/.env.local and set WALLET_PASSWORD there; bag auto-loads it.
|
|
68
58
|
# Never put the wallet password on a command line.
|
|
69
|
-
bag env set OPENROUTER_API_KEY <
|
|
59
|
+
bag env set OPENROUTER_API_KEY '<api-key>' # or whichever provider app/agent/studio.toml [llm] uses
|
|
70
60
|
|
|
71
|
-
# From the workspace root
|
|
61
|
+
# From the workspace root - `bag dev` serves the selected protocol:
|
|
72
62
|
bag dev # A2A agent on :9000, MCP on :8000/mcp (same for any destination)
|
|
73
63
|
bag dev --port 9100 # override the port
|
|
74
64
|
```
|
|
75
65
|
|
|
76
|
-
`bag dev` sets `STORAGE_LOCAL_PATH=~/.bag/deliverables/<workspace-name>/` for the
|
|
77
|
-
agent subprocess and runs it **without** Cognito env, so the local endpoint is
|
|
78
|
-
reachable without a token (Cognito is mandatory only on the deployed AgentCore
|
|
79
|
-
runtime). For A2A projects, the agent
|
|
80
|
-
(`app/agent/src/main.ts`) exposes `/.well-known/agent-card.json` +
|
|
81
|
-
JSON-RPC `message/send` + `GET /ping` on `:9000`. Smoke-test the card with curl:
|
|
66
|
+
`bag dev` sets `STORAGE_LOCAL_PATH=~/.bag/deliverables/<workspace-name>/` for the agent subprocess and runs it **without** Cognito env, so the local endpoint is reachable without a token (Cognito is mandatory only on the deployed AgentCore runtime). For A2A projects, the agent (`app/agent/src/main.ts`) exposes `/.well-known/agent-card.json` + JSON-RPC `message/send` + `GET /ping` on `:9000`. Smoke-test the card with curl:
|
|
82
67
|
|
|
83
68
|
```bash
|
|
84
69
|
curl http://localhost:9000/.well-known/agent-card.json
|
|
85
70
|
```
|
|
86
71
|
|
|
87
|
-
Expect the agent card with its two skills (`negotiate`, `notify_funded`).
|
|
88
|
-
For MCP projects, connect an MCP client to `http://localhost:8000/mcp`.
|
|
72
|
+
Expect the agent card with its two skills (`negotiate`, `notify_funded`). For MCP projects, connect an MCP client to `http://localhost:8000/mcp`.
|
|
89
73
|
|
|
90
|
-
> ⚠️ **The AgentCore inspector chat box cannot test a seller agent.** A seller's
|
|
91
|
-
> skills are structured A2A `DataPart`s (`message/send`), but the inspector chat
|
|
92
|
-
> box can only send plain text — it can never construct a `{"skill":"negotiate", …}`
|
|
93
|
-
> part, so it can't reach the agent's real product surface (and its streaming view
|
|
94
|
-
> expects Task events, not the `message` reply the agent emits). **Test locally
|
|
95
|
-
> with curl or an A2A client sending a `DataPart`**, not the chat box.
|
|
74
|
+
> ⚠️ **The AgentCore inspector chat box cannot test a seller agent.** A seller's skills are structured A2A `DataPart`s (`message/send`), but the inspector chat box can only send plain text - it can never construct a `{"skill":"negotiate", …}` part, so it can't reach the agent's real product surface (and its streaming view expects Task events, not the `message` reply the agent emits). **Test locally with curl or an A2A client sending a `DataPart`**, not the chat box.
|
|
96
75
|
|
|
97
|
-
Drive a sale by sending the skills directly (`negotiate` `terms` MUST include
|
|
98
|
-
`deliverables` + `quality_standards`, else the quote is rejected `reason_code 0x04`):
|
|
76
|
+
Drive a sale by sending the skills directly (`negotiate` `terms` MUST include `deliverables` + `quality_standards`, else the quote is rejected `reason_code 0x04`):
|
|
99
77
|
|
|
100
78
|
```bash
|
|
101
79
|
# negotiate → signed quote envelope
|
|
@@ -117,7 +95,7 @@ curl -s -X POST http://localhost:9000/ -H "Content-Type: application/json" -d '{
|
|
|
117
95
|
|
|
118
96
|
See `erc8183-buyer-push.md` for the full line protocol. Ctrl-C to stop.
|
|
119
97
|
|
|
120
|
-
### B. Doctor
|
|
98
|
+
### B. Doctor - full project health
|
|
121
99
|
|
|
122
100
|
```bash
|
|
123
101
|
bag doctor
|
|
@@ -126,17 +104,16 @@ bag doctor
|
|
|
126
104
|
Returns a rich table of checks across the `app/agent/` sub-project:
|
|
127
105
|
|
|
128
106
|
| Check | What FAIL means | Fix |
|
|
129
|
-
|
|
107
|
+
| --- | --- | --- |
|
|
130
108
|
| app/agent/studio.toml parseable | Missing or syntax error | `bag init` to regenerate, or hand-fix TOML |
|
|
131
109
|
| Agent entrypoint imports | Protocol entrypoint raises on load (`src/main.ts` for A2A, `src/mcpMain.ts` for MCP) | Fix the error printed by the check (often a missing env var or a broken import) |
|
|
132
110
|
| wallet keystore | No `<workspace>/.studio/wallets/*.json` | `bag wallet new` (writes to the workspace root keystore dir) |
|
|
133
111
|
| WALLET_PASSWORD env | Not in `.studio/.env.local` / not exported | Edit the owner-only `.studio/.env.local`; never pass the password on argv |
|
|
134
112
|
| LLM provider key | API key env not set | Edit `.studio/.env.local` or export the right `*_API_KEY` |
|
|
135
|
-
| Network reachable | RPC down/wrong URL | Override via `STUDIO_BSC_TESTNET_RPC=...` (testnet) / `STUDIO_BSC_RPC=...` (mainnet)
|
|
113
|
+
| Network reachable | RPC down/wrong URL | Override via `STUDIO_BSC_TESTNET_RPC=...` (testnet) / `STUDIO_BSC_RPC=...` (mainnet) - per-network env vars read by `@bnbagent/studio-runtime/networks` `getNetwork` |
|
|
136
114
|
| Wallet tBNB balance | 0 tBNB | Faucet: testnet.bnbchain.org/faucet-smart |
|
|
137
115
|
| Wallet U balance | 0 U | Transfer from holder, or ask for sponsor U |
|
|
138
|
-
| 8004 registered | Not registered | Normally registered automatically at `bag deploy verify`. Manual: `bag erc8004 register --endpoint <url>` (only if you need an on-chain identity before deploy). WARN-only in `bag doctor`
|
|
139
|
-
| Cognito authorizer (W9) | External-buyer readiness: `agentcore.json` carries no `authorizerConfiguration` / protocol metadata has placeholder `OAUTH_*` values | WARN-only (does NOT block) — needed to serve **external** buyers, not to deploy. With no authorizer the runtime is IAM/SigV4 owner-only (never anonymous). To open it to buyers: `bag deploy provision-cognito` → `cdk deploy --outputs-file cdk-outputs.json` → `bag deploy provision-cognito --wire`. |
|
|
116
|
+
| 8004 registered | Not registered | Normally registered automatically at `bag deploy verify`. Manual: `bag erc8004 register --endpoint <url>` (only if you need an on-chain identity before deploy). WARN-only in `bag doctor` - it doesn't block local dev. |
|
|
140
117
|
|
|
141
118
|
WARN-only items don't block; FAIL items do (exit 1).
|
|
142
119
|
|
|
@@ -150,39 +127,20 @@ bag wallet list # all keystores in <workspace>/.studio/wallets/
|
|
|
150
127
|
For on-chain balance of the configured wallet (BNB + U):
|
|
151
128
|
|
|
152
129
|
```bash
|
|
153
|
-
bag wallet balance # [network].default
|
|
130
|
+
bag wallet balance # [network].default - BNB + U
|
|
154
131
|
bag wallet balance --network bsc-mainnet # override to a specific network
|
|
155
132
|
bag wallet balance --all # both [network].default AND [llm.pieverse].network
|
|
156
133
|
```
|
|
157
134
|
|
|
158
|
-
The `--all` form is the right move when `app/agent/studio.toml`'s
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
`
|
|
167
|
-
incompatible commerce, router, and policy deployments.
|
|
168
|
-
|
|
169
|
-
For the inbound x402 seller rail, `bag doctor` also prints `PAID` or `FREE`.
|
|
170
|
-
PAID requires the complete B402 merchant credential set and an `evm-local` or
|
|
171
|
-
`twak` payout wallet. Explicit zero is anonymous FREE passthrough: it does not
|
|
172
|
-
read B402 credentials, call the facilitator, settle a payment, or apply the
|
|
173
|
-
paid-mode payout-wallet allowlist. Confirm the same state with
|
|
174
|
-
`bag x402 sell status`.
|
|
175
|
-
|
|
176
|
-
> ⚠️ **v0.2 backlog — not in v0.0.x.** There is **no** `bag wallet transfer`,
|
|
177
|
-
> no `bag erc20 approve/allowance` group, and no `bag wallet balance --address`
|
|
178
|
-
> / `--token` flag in v0.0.x — running any of them errors with
|
|
179
|
-
> `invalid choice` / `unrecognized arguments`. To move funds or set allowances
|
|
180
|
-
> today, use an external wallet; ERC-8183 funding auto-approves U as part of the
|
|
181
|
-
> buy flow. These CLIs are planned for v0.2.
|
|
182
|
-
|
|
183
|
-
For programmatic access from inside an agent's code, the MCP tools (when wired
|
|
184
|
-
into Claude Code) provide `balance_u` / `balance_native` as well — but the CLI
|
|
185
|
-
is the fastest path during dev.
|
|
135
|
+
The `--all` form is the right move when `app/agent/studio.toml`'s `[network].default = bsc-testnet` and `[llm].provider = pieverse-llm`: testnet U pays ERC-8183 jobs, mainnet U pays the Pieverse LLM auto-renew. Same wallet address on both chains.
|
|
136
|
+
|
|
137
|
+
`bag doctor` prints ERC-8183 pricing as `PAID` or `FREE`. FREE is not ready on the canonical contract stack: select one zero-price-compatible custom stack by setting `ERC8183_COMMERCE_ADDRESS`, `ERC8183_ROUTER_ADDRESS`, and `ERC8183_POLICY_ADDRESS` together. A partial set fails because it can mix incompatible commerce, router, and policy deployments.
|
|
138
|
+
|
|
139
|
+
For the inbound x402 seller rail, `bag doctor` also prints `PAID` or `FREE`. PAID requires the complete B402 merchant credential set and an `evm-local` or `twak` payout wallet. Explicit zero is anonymous FREE passthrough: it does not read B402 credentials, call the facilitator, settle a payment, or apply the paid-mode payout-wallet allowlist. Confirm the same state with `bag x402 sell status`.
|
|
140
|
+
|
|
141
|
+
> The current CLI has no `bag wallet transfer`, `bag erc20 approve/allowance` group, or `bag wallet balance --address` / `--token` flag. Running them returns an invalid-command or unknown-option error. Use an external wallet to move funds or set allowances; ERC-8183 funding auto-approves U as part of the buy flow.
|
|
142
|
+
|
|
143
|
+
For programmatic access from inside an agent's code, the MCP tools (when wired into Claude Code) provide `balance_u` / `balance_native` as well - but the CLI is the fastest path during dev.
|
|
186
144
|
|
|
187
145
|
### D. Job state inspection (8183)
|
|
188
146
|
|
|
@@ -192,29 +150,18 @@ bag erc8183 list --provider 0xPROV # jobs I could serve as seller
|
|
|
192
150
|
bag erc8183 status <job_id> # one job's full record
|
|
193
151
|
```
|
|
194
152
|
|
|
195
|
-
JobStatus enum: `OPEN` (0) → `FUNDED` (1) → `SUBMITTED` (2) → `COMPLETED` (3) /
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
`FUNDED` jobs are what the deployed agent delivers — either when the buyer sends a
|
|
199
|
-
`notify_funded` A2A message (the agent acks then delivers in the **background**;
|
|
200
|
-
read the result from the chain) or via the deduped background sweep on the next
|
|
201
|
-
notify (see `erc8183-buyer-push.md`). While background work is in flight the
|
|
202
|
-
runtime stays warm via `/ping` `HEALTHY_BUSY`; a scaled-to-zero idle agent won't
|
|
203
|
-
deliver until the next notify (a v2 Lambda poller closes that cold window).
|
|
204
|
-
`SUBMITTED` jobs trigger the **buyer decision
|
|
205
|
-
tree** (approve / dispute / reject within the dispute window) — full flow in the
|
|
206
|
-
`bnbagent-studio-buying-via-8183.md` reference (see the Deep-dive references
|
|
207
|
-
list above). From the seller side, defending a dispute is
|
|
208
|
-
covered in `bnbagent-studio-selling-via-8183.md` (same directory).
|
|
153
|
+
JobStatus enum: `OPEN` (0) → `FUNDED` (1) → `SUBMITTED` (2) → `COMPLETED` (3) / `REJECTED` (4) / `EXPIRED` (5).
|
|
154
|
+
|
|
155
|
+
`FUNDED` jobs are what the deployed agent delivers - either when the buyer sends a `notify_funded` A2A message (the agent acks then delivers in the **background**; read the result from the chain) or via the deduped background sweep on the next notify (see `erc8183-buyer-push.md`). While background work is in flight the runtime stays warm via `/ping` `HEALTHY_BUSY`; a scaled-to-zero idle agent won't deliver until the next notify (a v2 Lambda poller closes that cold window). `SUBMITTED` jobs trigger the **buyer decision tree** (approve / dispute / reject within the dispute window) - full flow in the `bnbagent-studio-buying-via-8183.md` reference (see the Deep-dive references list above). From the seller side, defending a dispute is covered in `bnbagent-studio-selling-via-8183.md` (same directory).
|
|
209
156
|
|
|
210
157
|
### E. Common errors + remediation
|
|
211
158
|
|
|
212
159
|
| Error pattern | Cause | Fix |
|
|
213
|
-
|
|
160
|
+
| --- | --- | --- |
|
|
214
161
|
| `Submission deadline has passed` | Buyer set `expiredAt` too soon (< dispute_window) | Use `--deadline-min` ≥ 1 (workflow auto-adds dispute_window now) |
|
|
215
162
|
| `Transaction would revert: ('0x17be5b7b', ...)` | Trying to `settle approve` before dispute_window | Wait 24h or use `--action dispute` |
|
|
216
|
-
| `notify_funded` replies `{"status":"rejected","reason":...}` | `verifySignedJob` failed synchronously in the ack
|
|
217
|
-
| Job stays `FUNDED`, never reaches `SUBMITTED` after an `accepted` ack | Background delivery failed (`runWork` / `submitResult` raised)
|
|
163
|
+
| `notify_funded` replies `{"status":"rejected","reason":...}` | `verifySignedJob` failed synchronously in the ack - a **permanent** failure | `reason` names it: not our signature / tampered terms / underfunded / expired (or `error` for a malformed `job_id`). The job is refused outright; re-fund/re-notify with a correct, fully-funded job |
|
|
164
|
+
| Job stays `FUNDED`, never reaches `SUBMITTED` after an `accepted` ack | Background delivery failed (`runWork` / `submitResult` raised) - **not** visible in the A2A reply | The ack only confirms verify passed; delivery runs in the background. Observe the failure via the chain (job never leaves `FUNDED`) + CloudWatch logs; a later `notify_funded` re-attempts it via the sweep |
|
|
218
165
|
| `ERC8183JobOps` has no such export from `@bnbagent/sdk` | package.json pinned an old `@bnbagent/sdk` (missing class) | Bump the dependency and reinstall |
|
|
219
166
|
| FREE price fails doctor/prepare on canonical contracts | `price = "0"` is selected without a zero-price-compatible stack | Set all three `ERC8183_*_ADDRESS` overrides from one compatible custom deployment, then rerun `bag doctor` and `bag deploy prepare` |
|
|
220
167
|
| ERC-8183 contract override is incomplete | Only one or two of commerce/router/policy were selected | Set or remove all three together; never mix stacks |
|
|
@@ -227,4 +174,4 @@ covered in `bnbagent-studio-selling-via-8183.md` (same directory).
|
|
|
227
174
|
|
|
228
175
|
- `docs/design/single-seller-agent.md` (the A2A deploy model and history)
|
|
229
176
|
- `docs/design/erc8183-buyer-push.md` (how a buyer drives an A2A sale)
|
|
230
|
-
- `docs/design/architecture.md §2.5` (the single seller runtime
|
|
177
|
+
- `docs/design/architecture.md §2.5` (the single seller runtime - as-built truth)
|