shll-skills 5.6.0 → 6.0.1

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 (42) hide show
  1. package/README.md +46 -18
  2. package/SKILL.md +88 -51
  3. package/dist/{chunk-E6V6FKRK.mjs → chunk-5GV6AGSA.mjs} +1373 -58
  4. package/dist/index.js +1470 -506
  5. package/dist/index.mjs +193 -546
  6. package/dist/mcp.js +1581 -825
  7. package/dist/mcp.mjs +262 -860
  8. package/package.json +38 -27
  9. package/.env.example +0 -9
  10. package/src/commands/agent.ts +0 -128
  11. package/src/commands/calldata.ts +0 -49
  12. package/src/commands/defi.ts +0 -191
  13. package/src/commands/fourmeme.ts +0 -149
  14. package/src/commands/index.ts +0 -20
  15. package/src/commands/info.ts +0 -150
  16. package/src/commands/lending.ts +0 -100
  17. package/src/commands/setup.ts +0 -76
  18. package/src/commands/transfer.ts +0 -62
  19. package/src/commands/utils.ts +0 -26
  20. package/src/index.ts +0 -22
  21. package/src/mcp.ts +0 -21
  22. package/src/shared/abi.ts +0 -213
  23. package/src/shared/clients.ts +0 -72
  24. package/src/shared/constants.ts +0 -40
  25. package/src/shared/errors.ts +0 -58
  26. package/src/shared/index.ts +0 -28
  27. package/src/shared/indexer.ts +0 -122
  28. package/src/shared/schemas.ts +0 -27
  29. package/src/shared/security.ts +0 -283
  30. package/src/shared/tokens.ts +0 -80
  31. package/src/shared/types.ts +0 -40
  32. package/src/tools/agent.ts +0 -210
  33. package/src/tools/calldata.ts +0 -123
  34. package/src/tools/defi.ts +0 -188
  35. package/src/tools/fourmeme.ts +0 -204
  36. package/src/tools/index.ts +0 -20
  37. package/src/tools/info.ts +0 -170
  38. package/src/tools/lending.ts +0 -90
  39. package/src/tools/setup.ts +0 -115
  40. package/src/tools/transfer.ts +0 -70
  41. package/tsconfig.json +0 -15
  42. package/tsup.config.ts +0 -10
package/README.md CHANGED
@@ -1,8 +1,13 @@
1
1
  # SHLL Skills — AI Agent DeFi Toolkit on BSC
2
2
 
3
- [![Website](https://img.shields.io/badge/Website-shll.run-blue)](https://shll.run) [![Twitter](https://img.shields.io/badge/Twitter-@shllrun-1DA1F2)](https://twitter.com/shllrun) [![npm](https://img.shields.io/npm/v/shll-skills)](https://www.npmjs.com/package/shll-skills)
3
+ [![Website](https://img.shields.io/badge/Website-shll.run-blue)](https://shll.run) [![Twitter](https://img.shields.io/badge/Twitter-@shllrun-1DA1F2)](https://twitter.com/shllrun) [![npm](https://img.shields.io/npm/v/shll-skills)](https://www.npmjs.com/package/shll-skills) [![ClawHub](https://img.shields.io/badge/ClawHub-shll--skills-orange)](https://clawhub.ai/kledx/shll-skills)
4
4
 
5
- A **CLI + MCP Server** toolkit that gives any AI agent the ability to execute DeFi operations on BSC Mainnet securely. Supports PancakeSwap V2/V3 swap routing, Venus Protocol lending, and more. All transactions are validated by the on-chain PolicyGuard even if the AI hallucinates, the contract rejects unsafe operations.
5
+ A **CLI + MCP Server** toolkit that gives any AI agent the ability to execute DeFi operations on BSC Mainnet securely. Supports PancakeSwap V2/V3 swaps, Venus lending, Four.meme bonding curve trades, setup flows, and raw calldata execution through PolicyGuard.
6
+
7
+ Version `6.0.0` finalizes the modular layout:
8
+ - `shared/*` for constants, clients, schemas, errors, ABIs, and cross-cutting helpers
9
+ - `services/*` for single-source business logic
10
+ - `commands/*` and `tools/*` as thin CLI/MCP adapters
6
11
 
7
12
  ## Install
8
13
 
@@ -20,6 +25,8 @@ This installs two binaries:
20
25
 
21
26
  The [Model Context Protocol](https://modelcontextprotocol.io/) lets AI agents discover and call SHLL tools natively — no CLI parsing needed.
22
27
 
28
+ > **Security:** RUNNER_PRIVATE_KEY must be a **dedicated operator hot wallet** with minimal BNB (~) for gas only. Generate one with shll-run generate-wallet. **Never use your main wallet or any wallet holding significant funds.** Even if this key is compromised, on-chain PolicyGuard limits the operator to policy-approved trades only it cannot withdraw vault funds or transfer the Agent NFT.
29
+
23
30
  ### Claude Desktop
24
31
 
25
32
  Edit `~/AppData/Roaming/Claude/claude_desktop_config.json` (Windows) or `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
@@ -70,28 +77,29 @@ The server communicates via **stdio** using JSON-RPC 2.0. Send `tools/list` to d
70
77
  | Tool | Type | Description |
71
78
  |------|------|-------------|
72
79
  | `portfolio` | Read | Vault holdings + token balances |
73
- | `balance` | Read | Operator wallet gas balance |
80
+ | `balance` | Read | BNB or token balance of the agent vault |
74
81
  | `price` | Read | Real-time token price (DexScreener) |
75
82
  | `search` | Read | Search token by name/symbol on BSC |
76
83
  | `tokens` | Read | List known token symbols + addresses |
77
- | `lending_info` | Read | Venus Protocol supply balances + APY |
78
84
  | `policies` | Read | View active on-chain policies + config |
79
- | `status` | Read | One-shot security overview (vault, operator, policies, activity) |
85
+ | `status` | Read | One-shot readiness overview with blockers, warnings, and next actions |
80
86
  | `history` | Read | Recent transactions + policy rejections |
81
- | `my_agents` | Read | List agents where current operator is authorized |
87
+ | `token_restriction` | Read | View token whitelist restriction status + whitelisted tokens |
82
88
  | `listings` | Read | Available agent templates for rent |
89
+ | `four_info` | Read | Query Four.meme bonding curve token info |
83
90
  | `swap` | Write | PancakeSwap V2/V3 auto-routing swap |
84
91
  | `wrap` | Write | BNB → WBNB in vault |
85
92
  | `unwrap` | Write | WBNB → BNB in vault |
86
93
  | `lend` | Write | Supply tokens to Venus for yield |
87
94
  | `redeem` | Write | Withdraw from Venus |
88
95
  | `transfer` | Write | Send BNB or ERC20 from vault |
96
+ | `four_buy` | Write | Buy a Four.meme bonding-curve token |
97
+ | `four_sell` | Write | Sell a Four.meme bonding-curve token |
89
98
  | `config` | Write | Configure risk parameters (spending limits, cooldown) |
90
99
  | `setup_guide` | Info | Generate dual-wallet onboarding URL + steps |
91
- | `generate_wallet` | Info | Create new operator wallet (address + key) |
100
+ | `generate_wallet` | Info | Create new operator wallet (not the owner, mint, or vault wallet) |
92
101
  | `execute_calldata` | Write | Execute raw calldata from any source through PolicyGuard |
93
102
  | `execute_calldata_batch` | Write | Execute multiple calldata actions atomically through PolicyGuard |
94
- | `token_restriction` | Read | View token whitelist restriction status + whitelisted tokens |
95
103
 
96
104
  ---
97
105
 
@@ -102,33 +110,40 @@ For OpenClaw, shell scripts, or manual use.
102
110
  ### Quick Start
103
111
 
104
112
  ```bash
105
- # 1. Generate an operator wallet (hot wallet for AI)
113
+ # 1. Generate an operator wallet (AI-only hot wallet)
106
114
  shll-run generate-wallet
107
115
  export RUNNER_PRIVATE_KEY="0x..."
108
116
 
109
- # 2. Get setup link (user completes on shll.run with their OWN wallet)
110
- shll-run setup-guide --listing-id 0xABC...DEF --days 30
117
+ # 2. Get setup link (user completes on shll.run with their OWNER wallet)
118
+ shll-run setup-guide -l 0xABC...DEF -d 30
119
+
120
+ # 3. After the user sends back token-id, verify readiness
121
+ shll-run status -k 5
122
+ shll-run portfolio -k 5
111
123
 
112
- # 3. Trade
113
- shll-run swap --from BNB --to USDC --amount 0.1 -k 5
124
+ # 4. Trade
125
+ shll-run swap -f BNB -t USDC -a 0.1 -k 5
114
126
  ```
115
127
 
128
+ In OpenClaw, AI should set `RUNNER_PRIVATE_KEY` for the current session automatically. Do not ask the user to edit environment variables manually during chat onboarding.
129
+
116
130
  ### Commands
117
131
 
118
132
  #### Trading
119
133
  ```bash
120
- shll-run swap -f <FROM> -t <TO> -a <AMT> -k <ID> # Auto V2/V3 routing
121
- shll-run swap -f BNB -t USDT -a 0.1 -k 5 --dex v3 --fee 500 # Force V3, 0.05% fee
134
+ shll-run swap -f <FROM> -t <TO> -a <AMT> -k <ID> # Auto V2/V3 routing
135
+ shll-run swap -f BNB -t USDT -a 0.1 -k 5 -v v3 -s 2 # Use V3 with 2% slippage
122
136
  shll-run wrap -a <BNB> -k <ID> # BNB -> WBNB
123
137
  shll-run unwrap -a <BNB> -k <ID> # WBNB -> BNB
124
138
  shll-run transfer --token <SYM> -a <AMT> --to <ADDR> -k <ID>
139
+ shll-run four_buy --token <ADDR> -a <BNB> -k <ID> # Buy on Four.meme bonding curve
140
+ shll-run four_sell --token <ADDR> -a <TOKEN_AMT> -k <ID> # Sell on Four.meme bonding curve
125
141
  ```
126
142
 
127
143
  #### Lending (Venus Protocol)
128
144
  ```bash
129
145
  shll-run lend -t USDT -a 100 -k <ID> # Supply to Venus
130
146
  shll-run redeem -t USDT -a 50 -k <ID> # Withdraw from Venus
131
- shll-run lending-info -k <ID> # Show APY + positions
132
147
  ```
133
148
 
134
149
  #### Market Data (read-only)
@@ -137,11 +152,13 @@ shll-run portfolio -k <ID> # Vault holdings + USD values
137
152
  shll-run price --token <SYM> # Real-time price (DexScreener)
138
153
  shll-run search --query <TEXT> # Find token by name
139
154
  shll-run tokens # List known tokens
155
+ shll-run four_info --token <ADDR> # Four.meme token status
140
156
  ```
141
157
 
142
158
  #### Risk Management
143
159
  ```bash
144
160
  shll-run policies -k <ID> # View active on-chain policies
161
+ shll-run status -k <ID> # Readiness, blockers, warnings, next actions
145
162
  shll-run config -k <ID> --tx-limit <BNB> --daily-limit <BNB> --cooldown <SEC>
146
163
  ```
147
164
 
@@ -156,23 +173,34 @@ AI Agent -> CLI/MCP -> PolicyClient.validate() -> PolicyGuard (on-chain) -> vaul
156
173
  1. AI constructs a tool call (MCP) or CLI command
157
174
  2. `PolicyClient.validate()` simulates against all on-chain policies
158
175
  3. If approved, `AgentNFA.execute()` routes through PolicyGuard → vault
159
- 4. PolicyGuard enforces: spending limits, cooldowns, DEX whitelist, DeFi guard
176
+ 4. PolicyGuard enforces: spending limits, cooldowns, recipient checks, and protocol rules
160
177
 
161
178
  ## Security: Dual-Wallet Architecture
162
179
 
163
180
  | | Owner Wallet | Operator Wallet (RUNNER_PRIVATE_KEY) |
164
181
  |---|---|---|
165
182
  | **Who holds it** | User (MetaMask/hardware) | AI agent |
183
+ | **Use it for** | Rent or mint the agent, hold the Agent NFT, authorize operator | Pay gas and execute policy-limited actions |
166
184
  | **Can trade** | — | ✅ Within PolicyGuard limits |
167
185
  | **Can withdraw vault** | ✅ | ❌ |
168
186
  | **Can transfer NFT** | ✅ | ❌ |
169
187
  | **Risk if leaked** | 🚨 Full vault access | ⚠️ Limited to policy-allowed trades |
170
188
 
189
+ Do not use the operator wallet to mint or rent the agent. Do not hold the Agent NFT in the operator wallet. Keep only a small BNB balance there for gas.
190
+
191
+ After setup, run `status` first. It returns a machine-friendly readiness object with:
192
+ - `readiness.ready`
193
+ - `readiness.blockers`
194
+ - `readiness.warnings`
195
+ - `readiness.nextActions`
196
+
197
+ This is the intended handoff for AI onboarding flows before any trading command.
198
+
171
199
  ## Environment Variables
172
200
 
173
201
  | Variable | Required | Description |
174
202
  |----------|----------|-------------|
175
- | `RUNNER_PRIVATE_KEY` | Yes | Operator wallet key (~$1 BNB for gas) |
203
+ | `RUNNER_PRIVATE_KEY` | Yes for write ops and agent-linked reads | Operator wallet key (~$1 BNB for gas) |
176
204
  | `SHLL_RPC` | No | BSC RPC URL override. Recommended: use a private RPC (e.g. QuickNode, Alchemy, GetBlock) for better reliability and speed |
177
205
 
178
206
  > **Note:** Contract addresses (AgentNFA, PolicyGuard) are hardcoded for security reasons. Override env vars are intentionally not supported to prevent supply-chain attacks.
package/SKILL.md CHANGED
@@ -1,13 +1,34 @@
1
1
  ---
2
2
  name: shll-run
3
3
  description: Execute DeFi transactions on BSC via SHLL AgentNFA. The AI handles all commands and users only need to chat.
4
- version: 5.5.3
4
+ version: 6.0.1
5
5
  author: SHLL Team
6
6
  website: https://shll.run
7
7
  twitter: https://twitter.com/shllrun
8
8
  repository: https://github.com/kledx/shll-skills.git
9
9
  install: npm install -g shll-skills --registry https://registry.npmjs.org
10
10
  update: npm update -g shll-skills --registry https://registry.npmjs.org
11
+ env:
12
+ - name: RUNNER_PRIVATE_KEY
13
+ required: true
14
+ description: >
15
+ Operator wallet private key (AI-only hot wallet).
16
+ MUST be a dedicated wallet with minimal BNB for gas only.
17
+ NEVER use your main wallet, owner wallet, or any wallet holding significant funds.
18
+ Even if this key leaks, on-chain PolicyGuard limits actions to policy-approved trades.
19
+ - name: SHLL_RPC
20
+ required: false
21
+ description: Optional BSC RPC URL override. A private RPC is recommended for reliability.
22
+ credentials:
23
+ scope: operator-hot-wallet-only
24
+ risk: >
25
+ The operator key can only execute policy-limited trades within on-chain PolicyGuard rules.
26
+ It cannot withdraw vault funds, transfer the Agent NFT, or bypass spending limits.
27
+ Treat it as a restricted session key, not a master key.
28
+ guidance: >
29
+ Use generate-wallet to create a purpose-built operator wallet.
30
+ Fund it with ~$1 BNB for gas only. Do not store trading capital in this wallet.
31
+ The operator wallet is NOT the owner wallet, NOT the vault, NOT the Agent NFT holder.
11
32
  ---
12
33
 
13
34
  # SHLL Skill Usage Guide
@@ -17,7 +38,6 @@ This file defines how an AI agent should use `shll-run` and `shll-mcp` safely.
17
38
  ## Scope
18
39
 
19
40
  - Network: BSC mainnet
20
- - Runtime:
21
41
  - CLI: `shll-run` (alias: `shll-onchain-runner`)
22
42
  - MCP: `shll-mcp`
23
43
  - Security layer: SHLL PolicyGuard
@@ -46,15 +66,15 @@ On-chain guardrails:
46
66
 
47
67
  - PolicyGuard validates each action (`validate`) before execution (`execute` / `executeBatch`).
48
68
  - Spending limits, cooldowns, whitelist rules, and protocol rules are enforced on-chain.
49
- - Raw calldata path is guarded by recipient safety checks before on-chain execution.
69
+ - Raw calldata is blocked if the recipient cannot be decoded safely.
50
70
 
51
- ## Current Critical Constraints (v5.5.3)
71
+ ## Current Critical Constraints (v6.0.0)
52
72
 
53
73
  1. `init` command is disabled. Do not use it.
54
- 2. CLI `raw` requires `--i-understand-the-risk`.
74
+ 2. Raw calldata remains high risk; rely on strict recipient safety checks.
55
75
  3. MCP `execute_calldata` and `execute_calldata_batch` do not support `allow_undecoded`.
56
76
  4. If calldata recipient cannot be decoded, execution is blocked.
57
- 5. Core contract addresses are pinned in code, not user-overridable at runtime.
77
+ 5. Core contract addresses are pinned in `src/shared/constants.ts`, not user-overridable at runtime.
58
78
 
59
79
  ## Prerequisites
60
80
 
@@ -68,7 +88,7 @@ npm install -g shll-skills --registry https://registry.npmjs.org
68
88
  export RUNNER_PRIVATE_KEY="0x..."
69
89
  ```
70
90
 
71
- 3. Optional use a private RPC for better reliability and speed:
91
+ 3. Optional - use a private RPC for better reliability and speed:
72
92
  ```bash
73
93
  export SHLL_RPC="https://your-private-bsc-rpc.example.com"
74
94
  ```
@@ -79,20 +99,32 @@ export SHLL_RPC="https://your-private-bsc-rpc.example.com"
79
99
 
80
100
  1. Check or create operator wallet:
81
101
  - Use `shll-run generate-wallet` only if user has no operator wallet.
82
- - Immediately instruct user to store the key securely.
102
+ - Immediately explain that this is the operator hot wallet for AI only.
103
+ - Explicitly state that it is not the owner wallet, not the mint wallet, not the Agent NFT wallet, and not the vault wallet.
104
+ - Explicitly state that if the operator wallet leaks, vault funds still cannot be freely withdrawn because owner permissions stay on the owner wallet and PolicyGuard limits operator actions.
105
+ - In OpenClaw, set `RUNNER_PRIVATE_KEY` automatically for the current session after generating the wallet. Do not ask the user to set the environment variable manually.
83
106
 
84
107
  2. Verify gas:
85
- - Run `shll-run balance`.
108
+ - Ensure the operator wallet has a small BNB balance for gas.
86
109
 
87
110
  3. If user has no token ID:
88
111
  - Run `shll-run listings`.
89
- - Ask user to choose template and rental days.
90
- - Run `shll-run setup-guide --listing-id <id> --days <days>`.
91
- - Send `setupUrl` to user for browser completion.
112
+ - Recommend the listing with `recommended=true` by default unless the user explicitly wants a specialized template.
113
+ - Run `shll-run setup-guide -l <listingId> -d <days>`.
114
+ - Send `setupUrl` plus the wallet-role explanation.
115
+ - Explicitly warn: do not use the operator wallet to mint, rent, or hold the Agent NFT.
116
+ - Explicitly warn: use the owner wallet in the browser for rental or mint and for operator authorization.
92
117
 
93
118
  4. User returns with token ID:
119
+ - Run `shll-run status -k <tokenId>`.
94
120
  - Run `shll-run portfolio -k <tokenId>`.
95
- - Confirm readiness and proceed with requested operation.
121
+ - Use `status.readiness.ready`, `status.readiness.blockers`, and `status.readiness.nextActions` as the primary onboarding diagnosis.
122
+ - Automatically check:
123
+ - operator gas balance
124
+ - vault BNB balance
125
+ - vault token balances
126
+ - access or policy readiness
127
+ - Tell the user whether the agent is ready, and if not, tell them the exact next fix.
96
128
 
97
129
  ## Write Confirmation Policy
98
130
 
@@ -115,8 +147,8 @@ Write commands include:
115
147
  - `lend`
116
148
  - `redeem`
117
149
  - `config`
118
- - `four-buy`
119
- - `four-sell`
150
+ - `four_buy`
151
+ - `four_sell`
120
152
 
121
153
  Read-only commands do not require confirmation.
122
154
 
@@ -126,12 +158,11 @@ Read-only commands do not require confirmation.
126
158
 
127
159
  - `shll-run generate-wallet`
128
160
  - `shll-run balance`
129
- - `shll-run doctor`
130
161
  - `shll-run listings`
131
162
  - `shll-run setup-guide [-l <listingId>] [-d <days>]`
132
163
  - `shll-run init` (disabled)
133
164
 
134
- If `-l/--listing-id` is omitted, `setup-guide` auto-selects an active listing from indexer.
165
+ If `-l/--listing` is omitted, `setup-guide` auto-selects an active listing from the indexer.
135
166
 
136
167
  ### Trading and vault ops
137
168
 
@@ -139,21 +170,20 @@ If `-l/--listing-id` is omitted, `setup-guide` auto-selects an active listing fr
139
170
  - `shll-run wrap -a <bnb> -k <tokenId>`
140
171
  - `shll-run unwrap -a <bnb> -k <tokenId>`
141
172
  - `shll-run transfer --token <symbolOrAddress> -a <amount> --to <address> -k <tokenId>`
142
- - `shll-run raw --target <address> --data <hex> -k <tokenId> --i-understand-the-risk`
173
+ - `shll-run raw --target <address> --data <hex> -k <tokenId>`
143
174
 
144
175
  ### Lending (Venus)
145
176
 
146
177
  - `shll-run lend -t <token> -a <amount> -k <tokenId>`
147
178
  - `shll-run redeem -t <token> -a <amount> -k <tokenId>`
148
- - `shll-run lending-info -k <tokenId>`
149
179
 
150
180
  ### Four.meme
151
181
 
152
- - `shll-run four-info --token <address>`
153
- - `shll-run four-buy --token <address> -a <bnb> -k <tokenId>`
154
- - `shll-run four-sell --token <address> -a <tokenAmount> -k <tokenId>`
182
+ - `shll-run four_info --token <address>`
183
+ - `shll-run four_buy --token <address> -a <bnb> -k <tokenId>`
184
+ - `shll-run four_sell --token <address> -a <tokenAmount> -k <tokenId>`
155
185
 
156
- `four-buy` amount unit is BNB, not USD. If user gives a USD target, convert to BNB first and confirm final BNB amount before execution.
186
+ `four_buy` amount unit is BNB, not USD. If user gives a USD target, convert to BNB first and confirm the final BNB amount before execution.
157
187
 
158
188
  ### Read-only and audit
159
189
 
@@ -164,13 +194,12 @@ If `-l/--listing-id` is omitted, `setup-guide` auto-selects an active listing fr
164
194
  - `shll-run policies -k <tokenId>`
165
195
  - `shll-run status -k <tokenId>`
166
196
  - `shll-run history -k <tokenId> [--limit N]`
167
- - `shll-run my-agents`
168
197
 
169
198
  ## MCP Tools: Cross-skill Execution
170
199
 
171
200
  For external aggregator calldata (OKX, 1inch, etc.):
172
201
 
173
- 1. Get quote/calldata from external source.
202
+ 1. Get quote/calldata from the external source.
174
203
  2. Execute through SHLL MCP:
175
204
  - `execute_calldata`
176
205
  - `execute_calldata_batch`
@@ -182,59 +211,68 @@ Security requirements:
182
211
 
183
212
  1. Recipient must resolve to the vault address.
184
213
  2. Undecodable recipient calldata is blocked.
185
- 3. Do not ask for "unsafe bypass" parameters.
214
+ 3. Do not ask for unsafe bypass parameters.
186
215
 
187
216
  ## Smart Routing Rule
188
217
 
189
- When user provides a token address:
218
+ When the user provides a token address:
190
219
 
191
- 1. Run `four-info --token <addr>`.
192
- 2. If `tradingPhase` is bonding curve, use `four-buy` / `four-sell`.
193
- 3. If `tradingPhase` is DEX (or unsupported), use `swap`.
220
+ 1. Run `four_info --token <addr>`.
221
+ 2. If `tradingPhase` is bonding curve, use `four_buy` / `four_sell`.
222
+ 3. If `tradingPhase` is DEX or unsupported, use `swap`.
194
223
 
195
224
  ## Common Errors and Fixes
196
225
 
197
226
  1. `RUNNER_PRIVATE_KEY environment variable is missing`
198
- - Set `RUNNER_PRIVATE_KEY` and retry.
199
- - Or run `shll-run doctor` to get guided next steps.
227
+ - In OpenClaw, AI should set `RUNNER_PRIVATE_KEY` automatically for the current session.
228
+ - Outside OpenClaw, set `RUNNER_PRIVATE_KEY` manually and retry.
200
229
 
201
230
  2. `NOT authorized for token-id`
202
231
  - Operator wallet is not authorized; use setup guide or set operator in console.
203
232
 
204
233
  3. `rental has EXPIRED` or `operator authorization has EXPIRED`
205
- - Renew subscription/authorization first.
234
+ - Renew subscription or authorization first.
206
235
 
207
- 4. `status: rejected`
208
- - PolicyGuard rejected action; inspect `reason` and adjust limits/whitelists/cooldown.
236
+ 4. `status: error` with `errorCode: POLICY_REJECTED`
237
+ - Inspect `details.reason` and adjust limits, whitelists, cooldown, or policy config.
209
238
 
210
239
  5. `Unable to decode recipient from calldata`
211
- - Use built-in command flow or provide calldata with decodable vault recipient.
240
+ - Use built-in command flow or provide calldata with a decodable vault recipient.
212
241
 
213
- 6. `init command is disabled`
214
- - Use `setup-guide` flow instead.
242
+ 6. `No V2/V3 liquidity or direct path found`
243
+ - The pair does not exist or lacks liquidity. DO NOT tell the user to wrap BNB to WBNB; the `swap` command handles native BNB automatically via `swapExactETHForTokens`. If a swap fails, it's because the direct pool is empty or invalid, not because BNB is unplugged.
215
244
 
216
- 7. Unsure what is broken
217
- - Run `shll-run doctor` for one-shot environment, wallet, RPC, and optional token-id checks.
245
+ 7. `init command is disabled`
246
+ - Use `setup-guide` instead.
218
247
 
219
- ## Redeploy Checklist (When Contracts Change)
248
+ 8. Unsure what is broken
249
+ - Check the structured `errorCode`, `message`, and `details` fields in the JSON response first.
220
250
 
221
- If AgentNFA / PolicyGuard / ListingManagerV2 / default listing changes:
251
+ ## Product UX Rules
222
252
 
223
- 1. Update constants in:
224
- - `src/index.ts`
225
- - `src/mcp.ts`
253
+ 1. Never describe `generate-wallet` as if it were the user's main wallet.
254
+ 2. Always call it the operator wallet or AI hot wallet.
255
+ 3. Always explain the dual-wallet model the first time setup is discussed.
256
+ 4. Always warn that the operator wallet must not be used to mint, rent, or hold the Agent NFT.
257
+ 5. Do not ask the user to manually set `RUNNER_PRIVATE_KEY` in OpenClaw; AI should do it.
258
+ 6. After setup is complete and the user provides a token-id, run readiness checks automatically before asking the user what to do next.
259
+ 7. When multiple listings are available, recommend one by default and explain why.
260
+ 8. Prefer the structured `status.readiness` fields over ad-hoc prose when deciding the next user-facing instruction.
226
261
 
227
- 2. Validate ABIs if function signatures changed.
262
+ ## Redeploy Checklist
263
+
264
+ If AgentNFA, PolicyGuard, ListingManagerV2, or default listing changes:
228
265
 
266
+ 1. Update constants in `src/shared/constants.ts`.
267
+ 2. Validate ABIs if function signatures changed.
229
268
  3. Rebuild:
230
269
  ```bash
231
270
  npx tsc --noEmit
232
271
  npm run build
233
272
  ```
234
-
235
273
  4. Smoke test:
236
- - `shll-run init` returns disabled error
237
- - `shll-run raw` blocks without risk flag
274
+ - `shll-run init` still returns disabled
275
+ - raw calldata still blocks undecodable recipients
238
276
  - basic read commands still work
239
277
 
240
278
  ## Expected Output Format
@@ -242,8 +280,7 @@ npm run build
242
280
  All runtime responses should stay machine-friendly JSON:
243
281
 
244
282
  - Success: `{"status":"success", ...}`
245
- - Rejected: `{"status":"rejected","reason":"..."}`
246
- - Error: `{"status":"error","message":"..."}`
283
+ - Error: `{"status":"error","errorCode":"...", "message":"...", ...}`
247
284
 
248
285
  ## Links
249
286