@wowok/skills 1.0.6 → 1.1.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 +11 -11
- package/package.json +1 -1
- package/schemas/onchain_operations/_common.md +270 -100
- package/schemas/onchain_operations/_index.md +176 -2
- package/schemas/onchain_operations/allocation.md +18 -40
- package/schemas/onchain_operations/arbitration.md +61 -50
- package/schemas/onchain_operations/contact.md +14 -10
- package/schemas/onchain_operations/demand.md +24 -23
- package/schemas/onchain_operations/gen_passport.md +12 -32
- package/schemas/onchain_operations/guard.md +29 -109
- package/schemas/onchain_operations/machine.md +47 -28
- package/schemas/onchain_operations/order.md +25 -26
- package/schemas/onchain_operations/payment.md +9 -17
- package/schemas/onchain_operations/permission.md +26 -15
- package/schemas/onchain_operations/personal.md +22 -23
- package/schemas/onchain_operations/progress.md +12 -9
- package/schemas/onchain_operations/repository.md +43 -54
- package/schemas/onchain_operations/reward.md +23 -25
- package/schemas/onchain_operations/service.md +31 -57
- package/schemas/onchain_operations/treasury.md +29 -35
- package/schemas/schema-messenger_operation.md +1 -1
- package/schemas/schema-query_toolkit.md +37 -17
- package/wowok-build/SKILL.md +89 -556
- package/wowok-guard/SKILL.md +57 -6
- package/wowok-machine/SKILL.md +48 -1
- package/wowok-order/SKILL.md +35 -1
- package/wowok-safety/SKILL.md +154 -279
- package/wowok-tools/SKILL.md +2 -2
package/wowok-safety/SKILL.md
CHANGED
|
@@ -1,98 +1,49 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
2
|
name: wowok-safety
|
|
3
3
|
description: |
|
|
4
|
-
WoWok safety and
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
This skill is AUTOMATICALLY triggered before any on-chain write operation.
|
|
10
|
-
It ensures the AI never executes transactions without explicit user approval.
|
|
4
|
+
WoWok operational safety and best practices — ensures AI follows correct
|
|
5
|
+
conventions for security, transaction confirmation, object building workflow,
|
|
6
|
+
and common mistake prevention.
|
|
7
|
+
|
|
8
|
+
This skill is AUTOMATICALLY triggered before any on-chain operation.
|
|
11
9
|
when_to_use:
|
|
12
|
-
- AI is about to execute an
|
|
13
|
-
- AI is about to publish a Service or Machine
|
|
10
|
+
- AI is about to execute an on-chain write operation
|
|
14
11
|
- AI is about to transfer funds or modify financial parameters
|
|
15
|
-
- AI is about to
|
|
16
|
-
-
|
|
12
|
+
- AI is about to publish a Service or Machine
|
|
13
|
+
- AI is building multiple interdependent objects
|
|
14
|
+
- User mentions "confirm", "approve", "safe", "warning", "best practice"
|
|
17
15
|
always: true
|
|
18
16
|
---
|
|
19
17
|
|
|
20
|
-
# WoWok Safety &
|
|
21
|
-
|
|
22
|
-
## Core Safety Principle
|
|
23
|
-
|
|
24
|
-
**NEVER execute an on-chain write without explicit user confirmation.**
|
|
25
|
-
|
|
26
|
-
WoWok operations involve real blockchain transactions with real economic consequences. The AI MUST always:
|
|
27
|
-
1. Preview what will happen (dry run)
|
|
28
|
-
2. Present the preview clearly to the user
|
|
29
|
-
3. Wait for explicit confirmation
|
|
30
|
-
4. Only then execute
|
|
18
|
+
# WoWok Safety & Best Practices
|
|
31
19
|
|
|
32
|
-
##
|
|
20
|
+
## 1. Core Principles
|
|
33
21
|
|
|
34
|
-
###
|
|
22
|
+
### 1.1 Security & Safety
|
|
35
23
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
operation_type: "<type>",
|
|
39
|
-
data: { op: "<action>", ... }
|
|
40
|
-
// NO submission field → dry run only
|
|
41
|
-
})
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
The dry run validates parameters, checks permissions, and returns a preview of what will happen. **No state is changed.**
|
|
45
|
-
|
|
46
|
-
### Phase 2: Execute (ONLY after user confirms)
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
onchain_operations({
|
|
50
|
-
operation_type: "<type>",
|
|
51
|
-
data: { op: "<action>", ... },
|
|
52
|
-
submission: {
|
|
53
|
-
sender: "<account_name>",
|
|
54
|
-
gas_budget: "<amount>"
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
```
|
|
24
|
+
- **Hot Wallet Usage**: WoWok never exposes private keys. Treat it as a spending account for transfers, receipts, and commerce. Flag large transactions for explicit user confirmation.
|
|
25
|
+
- **Amount-Sensitive Operations**: Any token transfer, payment, or reward distribution MUST be verbally confirmed with the user before execution. Use `Payment` objects for commercial transfers when possible (they offer Guard validation and purpose tracking).
|
|
58
26
|
|
|
59
|
-
|
|
27
|
+
### 1.2 LOCAL vs ON-CHAIN
|
|
60
28
|
|
|
61
|
-
|
|
29
|
+
| Type | Tools | Gas | Confirmation |
|
|
30
|
+
|------|-------|-----|--------------|
|
|
31
|
+
| **LOCAL ONLY** | `account_operation`, `local_mark_operation`, `local_info_operation` | None | Not needed |
|
|
32
|
+
| **ON-CHAIN** | `onchain_operations`, `messenger_operation` (some ops), `wip_file` (sign) | Yes | Required |
|
|
33
|
+
| **QUERY** | `query_toolkit`, `onchain_table_data`, `onchain_events`, `guard2file`, `machineNode2file` | Read-only | Not needed |
|
|
34
|
+
| **ENCRYPTED** | `messenger_operation` (watch/send messages) | Local encryption | Not needed |
|
|
62
35
|
|
|
63
|
-
|
|
36
|
+
### 1.3 Default Account
|
|
64
37
|
|
|
65
|
-
|
|
66
|
-
|-----------|------|---------------------------|
|
|
67
|
-
| `payment` (send coins) | Direct fund transfer | ✅ Show amount, recipient, token type |
|
|
68
|
-
| `treasury` (deposit/withdraw) | Team fund changes | ✅ Show amount, operation type |
|
|
69
|
-
| `reward` (create/modify) | Incentive pool changes | ✅ Show reward rules, amounts |
|
|
70
|
-
| `allocation` (create/modify) | Auto-distribution rules | ✅ Show split percentages, recipients |
|
|
71
|
-
| `order` (create/confirm) | Order with payment | ✅ Show price, service, parties |
|
|
38
|
+
Empty string `""` means the default account. Always use `""` when the user does not specify an account.
|
|
72
39
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
These modify system structure and should be confirmed:
|
|
76
|
-
|
|
77
|
-
| Operation | Risk | Confirmation Required |
|
|
78
|
-
|-----------|------|----------------------|
|
|
79
|
-
| `service` (publish) | Makes service public | ✅ Confirm publish intent |
|
|
80
|
-
| `machine` (publish) | Makes workflow public | ✅ Confirm publish intent |
|
|
81
|
-
| `guard` (create/modify) | Changes validation rules | ✅ Show Guard logic summary |
|
|
82
|
-
| `permission` (modify) | Changes access control | ✅ Show permission changes |
|
|
83
|
-
|
|
84
|
-
### 🟢 LOW RISK: Read-Only Operations
|
|
40
|
+
---
|
|
85
41
|
|
|
86
|
-
|
|
87
|
-
- All `query_toolkit` operations
|
|
88
|
-
- All `onchain_table_data` operations
|
|
89
|
-
- `wowok_buildin_info`
|
|
90
|
-
- `documents_and_learn`
|
|
91
|
-
- `guard2file`, `machineNode2file` (export only)
|
|
42
|
+
## 2. Transaction Confirmation Protocol
|
|
92
43
|
|
|
93
|
-
|
|
44
|
+
**Core rule**: NEVER execute an on-chain write without explicit user confirmation.
|
|
94
45
|
|
|
95
|
-
|
|
46
|
+
### 2.1 Confirmation Template
|
|
96
47
|
|
|
97
48
|
```
|
|
98
49
|
📋 **Operation Preview**
|
|
@@ -102,280 +53,204 @@ When presenting a dry-run result for confirmation, ALWAYS use this format:
|
|
|
102
53
|
| Operation | {operation_type} — {op} |
|
|
103
54
|
| Object | {object_name} |
|
|
104
55
|
| Network | {network} |
|
|
105
|
-
|
|
|
56
|
+
| Account | {account} |
|
|
106
57
|
|
|
107
58
|
⚠️ **This will {describe_what_will_happen}**
|
|
108
59
|
|
|
109
60
|
Proceed with execution?
|
|
110
61
|
```
|
|
111
62
|
|
|
112
|
-
|
|
63
|
+
### 2.2 Amount Verification
|
|
113
64
|
|
|
114
|
-
|
|
65
|
+
- Always display amounts with token symbol (e.g., "10 WOW" not "10000000000").
|
|
66
|
+
- Query token decimals first if unsure: `query_toolkit({ query_type: "token_list" })`.
|
|
67
|
+
- **Amounts in operations are ALWAYS submitted as U64 integers**. If the user specifies "2 WOW", do NOT submit the string "2 WOW". Instead, calculate and submit `2000000000` (2 × 10^9, where 9 is WOW's decimals).
|
|
68
|
+
- **Never assume token decimals**. If the token's decimals cannot be queried, HALT the amount submission and alert the user. Do not proceed with hardcoded or guessed precision.
|
|
69
|
+
- Show both raw and human-readable amounts when clarifying with users.
|
|
115
70
|
|
|
116
|
-
1. **Always display the amount with token symbol** (not just raw number)
|
|
117
|
-
2. **Query token decimals first** if unsure about precision
|
|
118
|
-
```
|
|
119
|
-
query_toolkit({ query_type: "token_list" })
|
|
120
|
-
```
|
|
121
|
-
3. **Show both the raw amount and the human-readable amount**
|
|
122
|
-
4. **For allocations**: Show each recipient's percentage and estimated amount
|
|
123
|
-
5. **For rewards**: Show total pool size and distribution rules
|
|
124
71
|
|
|
125
|
-
|
|
72
|
+
### 2.3 Publish Confirmation
|
|
126
73
|
|
|
127
|
-
|
|
74
|
+
Before publishing a Service or Machine:
|
|
128
75
|
|
|
129
|
-
1. **
|
|
130
|
-
2. **Verify
|
|
131
|
-
3. **
|
|
132
|
-
4. **Confirm the publish intent** — publishing is irreversible in practice
|
|
76
|
+
1. **Export and review**: Use `guard2file` and `machineNode2file` to export definitions
|
|
77
|
+
2. **Verify logic**: Confirm Guards and Machine nodes match user intent
|
|
78
|
+
3. **Warn about immutability**: Once published, many fields become locked
|
|
133
79
|
|
|
134
80
|
```
|
|
135
81
|
⚠️ PUBLISH CONFIRMATION REQUIRED
|
|
136
82
|
|
|
137
83
|
You are about to publish:
|
|
138
|
-
- Service: {name}
|
|
84
|
+
- {Service|Machine}: {name}
|
|
139
85
|
- This will make it publicly accessible on-chain
|
|
140
|
-
-
|
|
141
|
-
- Machine workflow: {summary} (if applicable)
|
|
86
|
+
- After publish: {list what becomes immutable}
|
|
142
87
|
|
|
143
88
|
This action cannot be easily undone. Proceed?
|
|
144
89
|
```
|
|
145
90
|
|
|
146
|
-
|
|
91
|
+
---
|
|
147
92
|
|
|
148
|
-
|
|
149
|
-
- **Never share private keys or sensitive data** — these are local-only
|
|
150
|
-
- **Always confirm which account is being used** as the sender for transactions
|
|
151
|
-
- **Check account balance** before operations that require gas
|
|
93
|
+
## 3. Common Mistakes to Avoid
|
|
152
94
|
|
|
153
|
-
|
|
95
|
+
| Mistake | Why It Happens | Prevention |
|
|
96
|
+
|---------|---------------|------------|
|
|
97
|
+
| **Forgetting no_cache** | Cache lag in dependency chain | Set `env.no_cache: true` on all operations when building multiple objects |
|
|
98
|
+
| **Missing permission indices** | Machine forwards reference non-existent indices | Verify Permission object has required indices before creating Machine |
|
|
154
99
|
|
|
155
|
-
|
|
156
|
-
2. ✅ Always get explicit confirmation before executing
|
|
157
|
-
3. ✅ Always show amounts with token symbols
|
|
158
|
-
4. ✅ Always warn before publishing
|
|
159
|
-
5. ✅ Always confirm the sender account
|
|
160
|
-
6. ✅ Always check for sufficient gas balance
|
|
100
|
+
---
|
|
161
101
|
|
|
162
|
-
##
|
|
102
|
+
## 4. Naming Conventions
|
|
163
103
|
|
|
164
|
-
|
|
165
|
-
2. ❌ Never skip the dry-run phase
|
|
166
|
-
3. ❌ Never hide or obscure financial amounts
|
|
167
|
-
4. ❌ Never publish without explicit user request
|
|
168
|
-
5. ❌ Never use a different account than what the user specified
|
|
169
|
-
6. ❌ Never proceed if the dry run shows errors
|
|
104
|
+
When users request complex systems without naming, propose this scheme:
|
|
170
105
|
|
|
171
|
-
|
|
106
|
+
```
|
|
107
|
+
<projectPrefix>_<type>_<purpose>_<version>
|
|
108
|
+
```
|
|
172
109
|
|
|
173
|
-
|
|
110
|
+
| Part | Example | Purpose |
|
|
111
|
+
|------|---------|---------|
|
|
112
|
+
| Project prefix | `shopFunny_` | Prevents cross-project collisions |
|
|
113
|
+
| Type prefix | `machine_`, `guard_`, `service_` | Clarifies object type |
|
|
114
|
+
| Purpose suffix | `serviceWithdraw` | Describes function |
|
|
115
|
+
| Version suffix | `_v2` | Enables iteration |
|
|
174
116
|
|
|
175
|
-
|
|
117
|
+
- Always provide `tags` on object creation for filtering and management
|
|
118
|
+
- Use short address form (`0x1234...def`); use names as primary identifiers
|
|
176
119
|
|
|
177
|
-
|
|
120
|
+
### 4.1 `replaceExistName` Flag
|
|
178
121
|
|
|
179
|
-
|
|
180
|
-
// Phase 1: Validate (no submission → no state change)
|
|
181
|
-
onchain_operations({
|
|
182
|
-
operation_type: "<type>",
|
|
183
|
-
data: { ... },
|
|
184
|
-
env: { account: "<name>", network: "testnet" }
|
|
185
|
-
})
|
|
186
|
-
→ Review the returned preview. Check: object IDs, guard logic, amounts.
|
|
187
|
-
|
|
188
|
-
// Phase 2: Execute (only after user confirms)
|
|
189
|
-
onchain_operations({
|
|
190
|
-
operation_type: "<type>",
|
|
191
|
-
data: { ... },
|
|
192
|
-
env: { account: "<name>", network: "testnet" },
|
|
193
|
-
submission: { sender: "<name>", gas_budget: "10000000" }
|
|
194
|
-
})
|
|
195
|
-
```
|
|
122
|
+
Controls name collision behavior:
|
|
196
123
|
|
|
197
|
-
|
|
124
|
+
| Value | Effect |
|
|
125
|
+
|-------|--------|
|
|
126
|
+
| `false` (default) | Throws error if name is in use — safe default |
|
|
127
|
+
| `true` | Steals name from existing object; old object becomes unnamed |
|
|
198
128
|
|
|
199
|
-
|
|
129
|
+
- Use `true` during development to reuse fixed names without cleanup
|
|
130
|
+
- Default to `false` in production to prevent accidental name hijacking
|
|
131
|
+
- Prefer versioned names (`_v1`, `_v2`) over `replaceExistName` for production
|
|
200
132
|
|
|
201
|
-
|
|
133
|
+
### 4.2 Address Display Rules
|
|
202
134
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
operation_type: "gen_passport",
|
|
211
|
-
data: { guard: "insurance_complete_guard_v1" },
|
|
212
|
-
info: { name: "guard_test", b_submission: true }
|
|
135
|
+
When displaying an address (0x prefix + 64 hex characters) to the user:
|
|
136
|
+
|
|
137
|
+
1. **Query local mark first**:
|
|
138
|
+
```typescript
|
|
139
|
+
query_toolkit({
|
|
140
|
+
query_type: "local_mark_list",
|
|
141
|
+
filter: { address: "0x<64_hex_chars>" }
|
|
213
142
|
})
|
|
214
143
|
```
|
|
215
|
-
This submits runtime values to the Guard and returns pass/fail — without any state change.
|
|
216
|
-
|
|
217
|
-
**From [Travel](../examples/Travel/Travel.md) — Weather Check Guard**
|
|
218
144
|
|
|
219
|
-
|
|
220
|
-
-
|
|
221
|
-
-
|
|
222
|
-
- Test with a timestamp that maps to "rainy" → should fail
|
|
223
|
-
- This validates the Guard BEFORE it protects real funds in an Allocation
|
|
145
|
+
2. **Display format**:
|
|
146
|
+
- If local mark exists: `{name} ({short_address})`
|
|
147
|
+
- If no local mark: `{first8}...{last3}` (e.g., `0x3a2f8e1...8c1`)
|
|
224
148
|
|
|
225
|
-
**
|
|
149
|
+
3. **Short address format**: Include `0x` prefix, take first 8 chars + `...` + last 3 chars
|
|
226
150
|
|
|
227
|
-
|
|
228
|
-
1. Export each Guard with `guard2file`
|
|
229
|
-
2. Test with `gen_passport`, submitting mock order progress data
|
|
230
|
-
3. Verify: correct node → pass, wrong node → fail
|
|
231
|
-
4. Only then bind to Service's `order_allocators`
|
|
151
|
+
---
|
|
232
152
|
|
|
233
|
-
|
|
153
|
+
## 5. Network & Token Defaults
|
|
234
154
|
|
|
235
|
-
|
|
155
|
+
| Parameter | Default Value | Notes |
|
|
156
|
+
|-----------|---------------|-------|
|
|
157
|
+
| Network | `testnet` | Override via `env.network` |
|
|
158
|
+
| Token | `0x2::wow::WOW` | 9 decimals (1 WOW = 1_000_000_000) |
|
|
236
159
|
|
|
237
|
-
|
|
160
|
+
### 5.1 Multi-Token Support & Amount Formats
|
|
238
161
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
│ └─ ⚠️ After publish: nodes become IMMUTABLE
|
|
246
|
-
│
|
|
247
|
-
├─ Service publish:
|
|
248
|
-
│ ├─ ✅ Machine bound to Service (machine field set)
|
|
249
|
-
│ ├─ ✅ Allocation rules finalized (order_allocators)
|
|
250
|
-
│ ├─ ✅ Sales/products defined (sales)
|
|
251
|
-
│ ├─ ✅ Guards tested (buy_guard, sell_guard)
|
|
252
|
-
│ └─ ⚠️ After publish: machine + allocation LOCKED
|
|
253
|
-
│
|
|
254
|
-
└─ Reward (post-publish):
|
|
255
|
-
└─ ✅ Can be added after Service publish (not locked)
|
|
256
|
-
```
|
|
162
|
+
- **Multi-Token**: All operations support custom `token_type`. ALWAYS query precision via `query_toolkit (token_list)` first. Never assume decimals.
|
|
163
|
+
- **Amount Formats**:
|
|
164
|
+
- With unit: `"2WOW"`, `"10.5USDT"` — auto-converted using token precision.
|
|
165
|
+
- Plain number: internal unit (e.g., `1000000000` = 1 WOW). Always clarify with users when displaying plain numbers.
|
|
166
|
+
- **U64 integers**: Amounts in operations are ALWAYS submitted as U64 integers. If the user specifies "2 WOW", do NOT submit the string "2 WOW" — calculate and submit `2000000000` (2 × 10^9).
|
|
167
|
+
- **Never assume token decimals**: If the token's decimals cannot be queried, HALT the amount submission and alert the user.
|
|
257
168
|
|
|
258
|
-
###
|
|
169
|
+
### 5.2 Payment Objects for Commercial Transfers
|
|
259
170
|
|
|
260
|
-
|
|
171
|
+
Use `Payment` objects for commercial transfers when possible — they offer Guard validation and purpose tracking beyond a simple `account_operation (transfer)`.
|
|
261
172
|
|
|
262
|
-
|
|
173
|
+
---
|
|
263
174
|
|
|
264
|
-
|
|
265
|
-
- `weather_provider_v1` creates and manages `weather_repo_v2`
|
|
266
|
-
- `travel_provider_v1` creates and manages `travel_service_v1`
|
|
175
|
+
## 6. Query-First Pattern
|
|
267
176
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
177
|
+
- **Query before mutate**: Always query current state before modifications. Use `query_toolkit` with filters.
|
|
178
|
+
- **Pagination**: All on-chain list queries (events, tables, received) support `cursor`/`limit`. Loop for large datasets.
|
|
179
|
+
- **Cache control**: Use `no_cache: true` for time-sensitive reads.
|
|
271
180
|
|
|
272
|
-
|
|
273
|
-
- Weather Repository + data exists before the Guard that queries it
|
|
274
|
-
- Insurance Service exists before Travel creates sub-orders on it
|
|
181
|
+
---
|
|
275
182
|
|
|
276
|
-
|
|
183
|
+
## 7. Name Resolution & Display
|
|
277
184
|
|
|
278
|
-
|
|
185
|
+
### 7.1 Name Resolution Priority
|
|
279
186
|
|
|
280
|
-
|
|
187
|
+
| Priority | Source | Display Format | Example |
|
|
188
|
+
|----------|--------|----------------|---------|
|
|
189
|
+
| 1 (Highest) | `local_mark_operation` | `{local_mark_name} (localmark)` | `my_service (localmark)` |
|
|
190
|
+
| 2 | `account_operation` (account name) | `{account_name}` | `alice_wallet` |
|
|
191
|
+
| 3 (Fallback) | None / Unnamed | `{first6}...{last3}` | `0x3a2f...8c1` |
|
|
281
192
|
|
|
282
|
-
|
|
283
|
-
|-----------|--------------|-------------|
|
|
284
|
-
| `service.sales[].price` | Raw integer (smallest unit) | Verify with: `wowok_buildin_info({ info_type: "token_list" })` |
|
|
285
|
-
| `order.buy.total_pay.balance` | Raw integer | Confirm matches sales price × quantity |
|
|
286
|
-
| `reward.coin_add` | Raw integer | Confirm pool size against expected payouts |
|
|
287
|
-
| `allocation.sharing[].sharing` | Integer (Rate mode: basis points) | 10000 = 100%, 500 = 5% |
|
|
193
|
+
### 7.2 Address Resolution & Display Format
|
|
288
194
|
|
|
289
|
-
**
|
|
290
|
-
```
|
|
291
|
-
sales: [{ name: "Outdoor Accident Insurance", price: 100000000, stock: 1000 }]
|
|
292
|
-
// 100000000 = 1 WOW (if 1 WOW = 10^8 smallest units)
|
|
293
|
-
```
|
|
195
|
+
**Resolve addresses to names** via `query_toolkit` with `local_names` query type:
|
|
294
196
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
197
|
+
```json
|
|
198
|
+
{
|
|
199
|
+
"query_type": "local_names",
|
|
200
|
+
"addresses": ["0x{64_hex_chars}", ...]
|
|
201
|
+
}
|
|
299
202
|
```
|
|
300
203
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
204
|
+
- Each address must be a valid WOW ID: `0x` prefix + **64 hex characters**.
|
|
205
|
+
- Returns `{ account?, local_mark?, address }[]` — for each address, the resolved account name and/or local mark name.
|
|
206
|
+
- Name priority follows [7.1](#71-name-resolution-priority): `local_mark` > `account`.
|
|
304
207
|
|
|
305
|
-
|
|
208
|
+
**Address truncation** (for display):
|
|
306
209
|
|
|
307
210
|
```
|
|
308
|
-
|
|
309
|
-
onchain_operations({ operation_type: "permission", data: { object: { name: "myshop_permission_v2", ... } }, env: { ... } })
|
|
310
|
-
|
|
311
|
-
// Query it — must bypass cache:
|
|
312
|
-
query_toolkit({ query_type: "onchain_objects", objects: ["myshop_permission_v2"], no_cache: true })
|
|
211
|
+
{first_6_chars}...{last_3_chars}
|
|
313
212
|
```
|
|
314
213
|
|
|
315
|
-
|
|
214
|
+
- Include the `0x` prefix in the character count.
|
|
215
|
+
- Use exactly **three dots** (`...`) as the separator.
|
|
216
|
+
- Example: `0x3a2f...8c1`
|
|
316
217
|
|
|
317
|
-
|
|
218
|
+
**Combined display**: human-readable name + truncated address in parentheses.
|
|
318
219
|
|
|
319
|
-
|
|
220
|
+
| Name Source | Display Format | Example |
|
|
221
|
+
|-------------|----------------|---------|
|
|
222
|
+
| local_mark | `{local_mark} ({first6}...{last3})` | `my_service (0x3a2f...8c1)` |
|
|
223
|
+
| account | `{account_name} ({first6}...{last3})` | `alice_wallet (0x3a2f...8c1)` |
|
|
224
|
+
| none (fallback) | `{first6}...{last3}` | `0x3a2f...8c1` |
|
|
320
225
|
|
|
321
|
-
|
|
226
|
+
---
|
|
322
227
|
|
|
323
|
-
|
|
324
|
-
data: {
|
|
325
|
-
object: { name: "myshop_permission_v2", replaceExistName: true, ... }
|
|
326
|
-
}
|
|
327
|
-
```
|
|
228
|
+
## 8. Error Patterns
|
|
328
229
|
|
|
329
|
-
|
|
230
|
+
| Error | Likely Cause |
|
|
231
|
+
|-------|-------------|
|
|
232
|
+
| Guard validation failure | After re-submitting with `submission`, Guard logic evaluated to false. Review Guard's rule tree via `guard2file` and submitted data values. |
|
|
233
|
+
| File parsing failure | `machineNode2file` or `guard2file` output format error. Check file format and schema compliance. |
|
|
234
|
+
| Cache stale reads | Sequential operations fail unexpectedly (e.g., "object not found" when just created). Retry with `env.no_cache: true`. |
|
|
235
|
+
| Permission denied | Operating account lacks the required Permission index. Check the object's Permission configuration. |
|
|
330
236
|
|
|
331
|
-
|
|
237
|
+
---
|
|
332
238
|
|
|
333
|
-
|
|
239
|
+
## 9. Testing & Validation Workflow
|
|
334
240
|
|
|
335
|
-
|
|
241
|
+
1. **Design Phase**: Use `wowok_buildin_info` to discover available permissions and Guard instructions
|
|
242
|
+
2. **Export & Review**: Before publishing, use `guard2file` and `machineNode2file` to export and review definitions
|
|
243
|
+
3. **Incremental Testing**: Build objects step-by-step, verifying each step
|
|
244
|
+
4. **Final Validation**: Test all Guard conditions and Machine transitions before publishing
|
|
245
|
+
5. **Publish**: Only after thorough testing, publish Service and Machine
|
|
336
246
|
|
|
337
|
-
|
|
338
|
-
```
|
|
339
|
-
onchain_operations({
|
|
340
|
-
operation_type: "machine",
|
|
341
|
-
data: {
|
|
342
|
-
object: { name: "insurance_machine_v1", permission: "..." },
|
|
343
|
-
node: { op: "add", nodes: [...] }, // nodes in same call
|
|
344
|
-
publish: true // publish in same call
|
|
345
|
-
}
|
|
346
|
-
})
|
|
347
|
-
```
|
|
247
|
+
---
|
|
348
248
|
|
|
349
|
-
|
|
350
|
-
```
|
|
351
|
-
// Step 1: Create machine (no nodes)
|
|
352
|
-
onchain_operations({ operation_type: "machine", data: { object: {...} } })
|
|
353
|
-
// Step 2: Add nodes (may not persist)
|
|
354
|
-
onchain_operations({ operation_type: "machine", data: { object: "...", node: { op: "add", nodes: [...] } } })
|
|
355
|
-
// Step 3: Publish
|
|
356
|
-
onchain_operations({ operation_type: "machine", data: { object: "...", publish: true } })
|
|
357
|
-
```
|
|
249
|
+
## 10. Incremental Object Building
|
|
358
250
|
|
|
359
|
-
|
|
251
|
+
For complex objects with many fields (Service, Machine), use **incremental building** instead of creating everything in one call:
|
|
360
252
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
│
|
|
366
|
-
├─ Is this a WRITE operation? (onchain_operations with submission)
|
|
367
|
-
│ ├─ Does it involve money? (payment, reward, treasury, allocation)
|
|
368
|
-
│ │ └─ 🔴 HIGH RISK — must show amounts + token type + recipient + get double confirmation
|
|
369
|
-
│ │
|
|
370
|
-
│ ├─ Does it publish something? (service.publish, machine.publish)
|
|
371
|
-
│ │ └─ 🟡 MEDIUM RISK — must show what will be locked + get confirmation
|
|
372
|
-
│ │
|
|
373
|
-
│ ├─ Does it modify guards/permissions? (guard, permission)
|
|
374
|
-
│ │ └─ 🟡 MEDIUM RISK — must explain what access changes + get confirmation
|
|
375
|
-
│ │
|
|
376
|
-
│ └─ Is it a structural change? (service.update, machine.node)
|
|
377
|
-
│ └─ 🟢 LOW-MEDIUM — show what changes + get confirmation
|
|
378
|
-
│
|
|
379
|
-
└─ Is this a DRY RUN? (no submission field)
|
|
380
|
-
└─ ✅ SAFE — no state change, but still review the preview for errors
|
|
381
|
-
```
|
|
253
|
+
- Each step can be verified before proceeding
|
|
254
|
+
- Errors are isolated to specific fields
|
|
255
|
+
- Easier to retry failed steps without re-executing successful ones
|
|
256
|
+
- Better user feedback at each stage
|
package/wowok-tools/SKILL.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
2
|
name: wowok-tools
|
|
3
3
|
description: |
|
|
4
4
|
Definitive WoWok MCP tool usage reference — the authoritative fallback when
|
|
@@ -619,7 +619,7 @@ When MCP tool schemas are unavailable or ambiguous, consult the complete schema
|
|
|
619
619
|
|
|
620
620
|
| Tool | Schema File | Contents |
|
|
621
621
|
|------|-----------|----------|
|
|
622
|
-
| `onchain_operations` | [schemas/onchain_operations/](../schemas/onchain_operations/) | 16 types split by operation_type. [_index.md](../schemas/onchain_operations/_index.md) for lookup, [_common.md](../schemas/onchain_operations/_common.md) for shared CallEnv
|
|
622
|
+
| `onchain_operations` | [schemas/onchain_operations/](../schemas/onchain_operations/) | 16 types split by operation_type. [_index.md](../schemas/onchain_operations/_index.md) for lookup, Value Types, and principles; [_common.md](../schemas/onchain_operations/_common.md) for shared schemas (CallEnv, SubmissionCall, Recipient, etc.) |
|
|
623
623
|
| `query_toolkit` | [schemas/schema-query_toolkit.md](../schemas/schema-query_toolkit.md) | 8 query_types, pagination params, filter structures |
|
|
624
624
|
| `onchain_table_data` | [schemas/schema-onchain_table_data.md](../schemas/schema-onchain_table_data.md) | 12 query_types, parent/key structures, result schemas |
|
|
625
625
|
| `onchain_events` | [schemas/schema-onchain_events.md](../schemas/schema-onchain_events.md) | Event query types, pagination |
|