shll-skills 5.5.3 → 6.0.0

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/README.md CHANGED
@@ -2,7 +2,12 @@
2
2
 
3
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)
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):
@@ -67,31 +74,32 @@ The server communicates via **stdio** using JSON-RPC 2.0. Send `tools/list` to d
67
74
 
68
75
  ### Available MCP Tools (24 total)
69
76
 
70
- | Tool | Type | Description |
71
- |------|------|-------------|
72
- | `portfolio` | Read | Vault holdings + token balances |
73
- | `balance` | Read | Operator wallet gas balance |
74
- | `price` | Read | Real-time token price (DexScreener) |
75
- | `search` | Read | Search token by name/symbol on BSC |
76
- | `tokens` | Read | List known token symbols + addresses |
77
- | `lending_info` | Read | Venus Protocol supply balances + APY |
78
- | `policies` | Read | View active on-chain policies + config |
79
- | `status` | Read | One-shot security overview (vault, operator, policies, activity) |
80
- | `history` | Read | Recent transactions + policy rejections |
81
- | `my_agents` | Read | List agents where current operator is authorized |
82
- | `listings` | Read | Available agent templates for rent |
83
- | `swap` | Write | PancakeSwap V2/V3 auto-routing swap |
84
- | `wrap` | Write | BNB → WBNB in vault |
85
- | `unwrap` | Write | WBNB → BNB in vault |
86
- | `lend` | Write | Supply tokens to Venus for yield |
87
- | `redeem` | Write | Withdraw from Venus |
88
- | `transfer` | Write | Send BNB or ERC20 from vault |
89
- | `config` | Write | Configure risk parameters (spending limits, cooldown) |
90
- | `setup_guide` | Info | Generate dual-wallet onboarding URL + steps |
91
- | `generate_wallet` | Info | Create new operator wallet (address + key) |
92
- | `execute_calldata` | Write | Execute raw calldata from any source through PolicyGuard |
93
- | `execute_calldata_batch` | Write | Execute multiple calldata actions atomically through PolicyGuard |
94
- | `token_restriction` | Read | View token whitelist restriction status + whitelisted tokens |
77
+ | Tool | Type | Description |
78
+ |------|------|-------------|
79
+ | `portfolio` | Read | Vault holdings + token balances |
80
+ | `balance` | Read | BNB or token balance of the agent vault |
81
+ | `price` | Read | Real-time token price (DexScreener) |
82
+ | `search` | Read | Search token by name/symbol on BSC |
83
+ | `tokens` | Read | List known token symbols + addresses |
84
+ | `policies` | Read | View active on-chain policies + config |
85
+ | `status` | Read | One-shot readiness overview with blockers, warnings, and next actions |
86
+ | `history` | Read | Recent transactions + policy rejections |
87
+ | `token_restriction` | Read | View token whitelist restriction status + whitelisted tokens |
88
+ | `listings` | Read | Available agent templates for rent |
89
+ | `four_info` | Read | Query Four.meme bonding curve token info |
90
+ | `swap` | Write | PancakeSwap V2/V3 auto-routing swap |
91
+ | `wrap` | Write | BNB → WBNB in vault |
92
+ | `unwrap` | Write | WBNB → BNB in vault |
93
+ | `lend` | Write | Supply tokens to Venus for yield |
94
+ | `redeem` | Write | Withdraw from Venus |
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 |
98
+ | `config` | Write | Configure risk parameters (spending limits, cooldown) |
99
+ | `setup_guide` | Info | Generate dual-wallet onboarding URL + steps |
100
+ | `generate_wallet` | Info | Create new operator wallet (not the owner, mint, or vault wallet) |
101
+ | `execute_calldata` | Write | Execute raw calldata from any source through PolicyGuard |
102
+ | `execute_calldata_batch` | Write | Execute multiple calldata actions atomically through PolicyGuard |
95
103
 
96
104
  ---
97
105
 
@@ -101,49 +109,58 @@ For OpenClaw, shell scripts, or manual use.
101
109
 
102
110
  ### Quick Start
103
111
 
104
- ```bash
105
- # 1. Generate an operator wallet (hot wallet for AI)
106
- shll-run generate-wallet
107
- export RUNNER_PRIVATE_KEY="0x..."
108
-
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
111
-
112
- # 3. Trade
113
- shll-run swap --from BNB --to USDC --amount 0.1 -k 5
114
- ```
112
+ ```bash
113
+ # 1. Generate an operator wallet (AI-only hot wallet)
114
+ shll-run generate-wallet
115
+ export RUNNER_PRIVATE_KEY="0x..."
116
+
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
123
+
124
+ # 4. Trade
125
+ shll-run swap -f BNB -t USDC -a 0.1 -k 5
126
+ ```
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.
115
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
122
- shll-run wrap -a <BNB> -k <ID> # BNB -> WBNB
123
- shll-run unwrap -a <BNB> -k <ID> # WBNB -> BNB
124
- shll-run transfer --token <SYM> -a <AMT> --to <ADDR> -k <ID>
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
136
+ shll-run wrap -a <BNB> -k <ID> # BNB -> WBNB
137
+ shll-run unwrap -a <BNB> -k <ID> # WBNB -> BNB
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
- shll-run lend -t USDT -a 100 -k <ID> # Supply to Venus
130
- shll-run redeem -t USDT -a 50 -k <ID> # Withdraw from Venus
131
- shll-run lending-info -k <ID> # Show APY + positions
145
+ shll-run lend -t USDT -a 100 -k <ID> # Supply to Venus
146
+ shll-run redeem -t USDT -a 50 -k <ID> # Withdraw from Venus
132
147
  ```
133
148
 
134
149
  #### Market Data (read-only)
135
150
  ```bash
136
- shll-run portfolio -k <ID> # Vault holdings + USD values
137
- shll-run price --token <SYM> # Real-time price (DexScreener)
138
- shll-run search --query <TEXT> # Find token by name
139
- shll-run tokens # List known tokens
151
+ shll-run portfolio -k <ID> # Vault holdings + USD values
152
+ shll-run price --token <SYM> # Real-time price (DexScreener)
153
+ shll-run search --query <TEXT> # Find token by name
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
- ```bash
144
- shll-run policies -k <ID> # View active on-chain policies
145
- shll-run config -k <ID> --tx-limit <BNB> --daily-limit <BNB> --cooldown <SEC>
146
- ```
159
+ ```bash
160
+ shll-run policies -k <ID> # View active on-chain policies
161
+ shll-run status -k <ID> # Readiness, blockers, warnings, next actions
162
+ shll-run config -k <ID> --tx-limit <BNB> --daily-limit <BNB> --cooldown <SEC>
163
+ ```
147
164
 
148
165
  ---
149
166
 
@@ -156,24 +173,35 @@ 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
- | | Owner Wallet | Operator Wallet (RUNNER_PRIVATE_KEY) |
164
- |---|---|---|
165
- | **Who holds it** | User (MetaMask/hardware) | AI agent |
166
- | **Can trade** | | Within PolicyGuard limits |
167
- | **Can withdraw vault** | | |
168
- | **Can transfer NFT** | ✅ | ❌ |
169
- | **Risk if leaked** | 🚨 Full vault access | ⚠️ Limited to policy-allowed trades |
180
+ | | Owner Wallet | Operator Wallet (RUNNER_PRIVATE_KEY) |
181
+ |---|---|---|
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 |
184
+ | **Can trade** | | Within PolicyGuard limits |
185
+ | **Can withdraw vault** | ✅ | ❌ |
186
+ | **Can transfer NFT** | | |
187
+ | **Risk if leaked** | 🚨 Full vault access | ⚠️ Limited to policy-allowed trades |
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.
170
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) |
176
- | `SHLL_RPC` | No | BSC RPC URL override (default: public BSC RPC) |
203
+ | `RUNNER_PRIVATE_KEY` | Yes for write ops and agent-linked reads | Operator wallet key (~$1 BNB for gas) |
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.
179
207
 
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.0
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,9 +88,9 @@ npm install -g shll-skills --registry https://registry.npmjs.org
68
88
  export RUNNER_PRIVATE_KEY="0x..."
69
89
  ```
70
90
 
71
- 3. Optional custom RPC:
91
+ 3. Optional - use a private RPC for better reliability and speed:
72
92
  ```bash
73
- export SHLL_RPC="https://bsc-dataseed1.binance.org"
93
+ export SHLL_RPC="https://your-private-bsc-rpc.example.com"
74
94
  ```
75
95
 
76
96
  4. Ensure operator wallet has small BNB balance for gas.
@@ -79,20 +99,32 @@ export SHLL_RPC="https://bsc-dataseed1.binance.org"
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,65 @@ 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
242
  6. `init command is disabled`
214
- - Use `setup-guide` flow instead.
243
+ - Use `setup-guide` instead.
215
244
 
216
245
  7. Unsure what is broken
217
- - Run `shll-run doctor` for one-shot environment, wallet, RPC, and optional token-id checks.
246
+ - Check the structured `errorCode`, `message`, and `details` fields in the JSON response first.
218
247
 
219
- ## Redeploy Checklist (When Contracts Change)
248
+ ## Product UX Rules
220
249
 
221
- If AgentNFA / PolicyGuard / ListingManagerV2 / default listing changes:
250
+ 1. Never describe `generate-wallet` as if it were the user's main wallet.
251
+ 2. Always call it the operator wallet or AI hot wallet.
252
+ 3. Always explain the dual-wallet model the first time setup is discussed.
253
+ 4. Always warn that the operator wallet must not be used to mint, rent, or hold the Agent NFT.
254
+ 5. Do not ask the user to manually set `RUNNER_PRIVATE_KEY` in OpenClaw; AI should do it.
255
+ 6. After setup is complete and the user provides a token-id, run readiness checks automatically before asking the user what to do next.
256
+ 7. When multiple listings are available, recommend one by default and explain why.
257
+ 8. Prefer the structured `status.readiness` fields over ad-hoc prose when deciding the next user-facing instruction.
222
258
 
223
- 1. Update constants in:
224
- - `src/index.ts`
225
- - `src/mcp.ts`
259
+ ## Redeploy Checklist
226
260
 
227
- 2. Validate ABIs if function signatures changed.
261
+ If AgentNFA, PolicyGuard, ListingManagerV2, or default listing changes:
228
262
 
263
+ 1. Update constants in `src/shared/constants.ts`.
264
+ 2. Validate ABIs if function signatures changed.
229
265
  3. Rebuild:
230
266
  ```bash
231
267
  npx tsc --noEmit
232
268
  npm run build
233
269
  ```
234
-
235
270
  4. Smoke test:
236
- - `shll-run init` returns disabled error
237
- - `shll-run raw` blocks without risk flag
271
+ - `shll-run init` still returns disabled
272
+ - raw calldata still blocks undecodable recipients
238
273
  - basic read commands still work
239
274
 
240
275
  ## Expected Output Format
@@ -242,8 +277,7 @@ npm run build
242
277
  All runtime responses should stay machine-friendly JSON:
243
278
 
244
279
  - Success: `{"status":"success", ...}`
245
- - Rejected: `{"status":"rejected","reason":"..."}`
246
- - Error: `{"status":"error","message":"..."}`
280
+ - Error: `{"status":"error","errorCode":"...", "message":"...", ...}`
247
281
 
248
282
  ## Links
249
283