@wowok/skills 1.1.2 → 1.1.4
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 +46 -7
- package/dist/cli.js +150 -35
- package/dist/cli.js.map +1 -1
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +16 -0
- package/dist/types.js.map +1 -1
- package/examples/MyShop_Advanced/MyShop_Advanced.md +220 -228
- package/examples/MyShop_Advanced/three_body_signature.wip +30 -0
- package/package.json +3 -1
- package/scripts/install.js +126 -15
- package/wowok-arbitrator/SKILL.md +192 -192
- package/wowok-guard/SKILL.md +189 -285
- package/wowok-machine/SKILL.md +167 -328
- package/wowok-messenger/SKILL.md +293 -0
- package/wowok-order/SKILL.md +6 -6
- package/wowok-output/SKILL.md +142 -0
- package/wowok-provider/SKILL.md +3 -1
- package/wowok-safety/SKILL.md +23 -59
- package/wowok-tools/SKILL.md +140 -537
package/wowok-tools/SKILL.md
CHANGED
|
@@ -1,620 +1,223 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wowok-tools
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
union branches, and stale cache issues.
|
|
10
|
-
|
|
11
|
-
Use this skill when:
|
|
12
|
-
- AI needs to select or invoke any WoWok MCP tool
|
|
13
|
-
- AI is unsure which tool fits a task
|
|
14
|
-
- AI needs exact parameter format for a specific operation_type
|
|
15
|
-
- AI encounters a tool error and needs troubleshooting
|
|
16
|
-
- MCP tool schemas are not auto-available in the current environment
|
|
17
|
-
- User asks "how do I..." for any WoWok operation
|
|
18
|
-
- AI needs to verify parameter types before calling
|
|
4
|
+
WoWok MCP tool reference — the fallback when schemas are unavailable.
|
|
5
|
+
Covers 13 tools with usage patterns, common pitfalls, and troubleshooting.
|
|
6
|
+
|
|
7
|
+
Core value: prevent common AI failures (wrong tool selection, incorrect
|
|
8
|
+
parameter formats, missing required fields, wrong discriminated unions).
|
|
19
9
|
when_to_use:
|
|
20
|
-
- AI
|
|
21
|
-
- AI
|
|
22
|
-
-
|
|
10
|
+
- AI needs to select or invoke any WoWok MCP tool
|
|
11
|
+
- AI encounters tool errors and needs debugging
|
|
12
|
+
- MCP tool schemas are not auto-available
|
|
23
13
|
- User asks "how do I..." for any WoWok operation
|
|
24
|
-
- AI needs exact schema for a specific operation_type or query_type
|
|
25
14
|
always: true
|
|
26
15
|
---
|
|
27
16
|
|
|
28
|
-
# WoWok MCP Tool
|
|
17
|
+
# WoWok MCP Tool Reference
|
|
29
18
|
|
|
30
|
-
|
|
19
|
+
Quick reference for WoWok MCP tools — patterns, pitfalls, and troubleshooting.
|
|
31
20
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
```
|
|
35
|
-
{
|
|
36
|
-
"operation_type": "<select from 16 types below>",
|
|
37
|
-
"data": { /* see specific operation_type for details */ },
|
|
38
|
-
"env": { "account": "", "network": "testnet" },
|
|
39
|
-
"submission": { /* only when Guard requires user submission */ }
|
|
40
|
-
}
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
**Critical Rules:**
|
|
44
|
-
1. `operation_type` MUST be one of the 16 types listed below
|
|
45
|
-
2. `data` structure changes based on `operation_type` — see each operation's details
|
|
46
|
-
3. `submission` is ONLY needed when Guard validation requires user-provided data
|
|
47
|
-
4. Most operations return directly; only Guard-triggered flows need a second call with `submission`
|
|
21
|
+
> **Domain Skills**: [wowok-guard](../wowok-guard/SKILL.md) (validation logic), [wowok-messenger](../wowok-messenger/SKILL.md) (encrypted messaging), [wowok-machine](../wowok-machine/SKILL.md) (workflows)
|
|
22
|
+
> **Business Skills**: [wowok-order](../wowok-order/SKILL.md) (customer), [wowok-provider](../wowok-provider/SKILL.md) (merchant), [wowok-arbitrator](../wowok-arbitrator/SKILL.md) (dispute resolution)
|
|
48
23
|
|
|
49
24
|
---
|
|
50
25
|
|
|
51
|
-
##
|
|
52
|
-
|
|
53
|
-
| # | Tool | Type | Description |
|
|
54
|
-
|---|------|------|-------------|
|
|
55
|
-
| 1 | `onchain_operations` | Write | All on-chain state changes (16 operation_types) |
|
|
56
|
-
| 2 | `query_toolkit` | Read | Local + on-chain data query (8 query_types) |
|
|
57
|
-
| 3 | `onchain_table_data` | Read | Dynamic field/table sub-item queries (12 query_types) |
|
|
58
|
-
| 4 | `account_operation` | Local | Wallet management — 100% local |
|
|
59
|
-
| 5 | `local_mark_operation` | Local | Name→address mappings — 100% local |
|
|
60
|
-
| 6 | `local_info_operation` | Local | Private data store — 100% local |
|
|
61
|
-
| 7 | `messenger_operation` | Hybrid | Encrypted messaging (local + on-chain) |
|
|
62
|
-
| 8 | `wip_file` | Hybrid | Witness promise files (generate/verify/sign) |
|
|
63
|
-
| 9 | `guard2file` | Read | Export Guard definition to local file |
|
|
64
|
-
| 10 | `machineNode2file` | Read | Export Machine nodes to local file |
|
|
65
|
-
| 11 | `onchain_events` | Read | Watch on-chain events (paginated) |
|
|
66
|
-
| 12 | `wowok_buildin_info` | Read | Protocol reference (constants/instructions) |
|
|
67
|
-
| 13 | `documents_and_learn` | Read | Documentation URLs |
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## 1. onchain_operations — On-Chain State Changes
|
|
72
|
-
|
|
73
|
-
**MCP Input**: `{ operation_type: string, data: object, submission?: object, env?: object }`
|
|
74
|
-
|
|
75
|
-
### operation_type Discriminated Union (16 types)
|
|
76
|
-
|
|
77
|
-
The `operation_type` field determines WHICH `data` schema applies. Each type has a COMPLETELY different `data` structure.
|
|
78
|
-
|
|
79
|
-
#### service — Service Listing
|
|
80
|
-
|
|
81
|
-
**Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_service" })`
|
|
82
|
-
|
|
83
|
-
**Key Fields**:
|
|
84
|
-
- `object`: TypedPermissionObject — STRING for existing, OBJECT for new
|
|
85
|
-
- `description`: Service description
|
|
86
|
-
- `location`: Service location
|
|
87
|
-
- `sales`: Sales configuration with operations (add/set/remove/clear)
|
|
88
|
-
- `repositories`: Repository objects
|
|
89
|
-
- `rewards`: Reward objects
|
|
90
|
-
- `arbitrations`: Arbitration objects
|
|
91
|
-
- `machine`: Machine object ID or null
|
|
92
|
-
- `discount`: Discount configuration
|
|
93
|
-
- `discount_destroy`: Array of discount names to destroy
|
|
94
|
-
- `customer_required`: Required customer info fields
|
|
95
|
-
- `order_allocators`: Fund distribution rules
|
|
96
|
-
- `buy_guard`: Guard ID for purchase validation
|
|
97
|
-
- `change_guard`: Guard ID for order changes
|
|
98
|
-
- `pause`: Pause service flag
|
|
99
|
-
- `publish`: Publish service flag (LOCKS machine and order_allocators)
|
|
100
|
-
- `owner_receive`: Owner fund extraction
|
|
101
|
-
- `um`: Contact object ID for Messenger
|
|
102
|
-
|
|
103
|
-
**Key Rules**:
|
|
104
|
-
- `publish: true` LOCKS `machine` reference and `order_allocators` — unchangeable after publish
|
|
105
|
-
- `rewards` and `arbitrations` can be ADDED after publish, not removed
|
|
106
|
-
- `sales`, `discount`, `description`, `location` remain mutable after publish
|
|
107
|
-
|
|
108
|
-
#### machine — Workflow Template
|
|
109
|
-
|
|
110
|
-
**Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_machine" })`
|
|
111
|
-
|
|
112
|
-
**Key Fields**:
|
|
113
|
-
- `object`: WithPermissionObject — STRING for existing, OBJECT for new
|
|
114
|
-
- `progress_new`: Progress new schema
|
|
115
|
-
- `description`: Machine description
|
|
116
|
-
- `repository`: Repository objects
|
|
117
|
-
- `node`: Node field schema with operations (add/set/remove/clear/exchange/rename) OR file path
|
|
118
|
-
- `pause`: Pause flag
|
|
119
|
-
- `publish`: Publish flag (makes nodes IMMUTABLE)
|
|
120
|
-
- `owner_receive`: Owner fund extraction
|
|
121
|
-
- `um`: Contact object ID
|
|
122
|
-
|
|
123
|
-
**Key Rules**:
|
|
124
|
-
- `publish: true` makes node definitions IMMUTABLE
|
|
125
|
-
- Machine must be created BEFORE Service references it
|
|
126
|
-
|
|
127
|
-
#### progress — Workflow Advancement
|
|
128
|
-
|
|
129
|
-
**Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_progress" })`
|
|
130
|
-
|
|
131
|
-
**Key Fields**:
|
|
132
|
-
- `object`: Progress object ID
|
|
133
|
-
- `order`: Order ID
|
|
134
|
-
- `node`: Single node advancement
|
|
135
|
-
- `nodes`: Multi-step advancement array
|
|
136
|
-
- `admin_hold`: Admin hold flag
|
|
137
|
-
- `admin_unhold`: Admin unhold flag
|
|
138
|
-
- `admin_unhold_node`: Admin unhold node index
|
|
139
|
-
- `accept`: Accept flag
|
|
140
|
-
- `recipient_accept`: Recipient for acceptance
|
|
141
|
-
- `owner_receive`: Owner fund extraction
|
|
142
|
-
- `um`: Contact object ID
|
|
143
|
-
|
|
144
|
-
#### repository — Consensus Data
|
|
145
|
-
|
|
146
|
-
**Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_repository" })`
|
|
147
|
-
|
|
148
|
-
**Key Fields**:
|
|
149
|
-
- `object`: WithPermissionObject
|
|
150
|
-
- `description`: Repository description
|
|
151
|
-
- `entity`: Entity reference
|
|
152
|
-
- `submit`: Submit records operation
|
|
153
|
-
- `submit_and_sign`: Submit and sign records
|
|
154
|
-
- `verify`: Verify records
|
|
155
|
-
- `vote`: Vote on records
|
|
156
|
-
- `owner_receive`: Owner fund extraction
|
|
157
|
-
- `um`: Contact object ID
|
|
158
|
-
|
|
159
|
-
#### arbitration — Dispute Resolution
|
|
160
|
-
|
|
161
|
-
**Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_arbitration" })`
|
|
162
|
-
|
|
163
|
-
**Key Fields**:
|
|
164
|
-
- `object`: WithPermissionObject
|
|
165
|
-
- `description`: Arbitration description
|
|
166
|
-
- `entity`: Entity reference
|
|
167
|
-
- `arbitrators`: Arbitrators configuration
|
|
168
|
-
- `owner_receive`: Owner fund extraction
|
|
169
|
-
- `um`: Contact object ID
|
|
170
|
-
|
|
171
|
-
#### contact — IM Contact Profile
|
|
172
|
-
|
|
173
|
-
**Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_contact" })`
|
|
174
|
-
|
|
175
|
-
**Key Fields**:
|
|
176
|
-
- `object`: WithPermissionObject
|
|
177
|
-
- `my_status`: Status message
|
|
178
|
-
- `description`: Contact description
|
|
179
|
-
- `location`: Location
|
|
180
|
-
- `ims`: IM addresses with operations (add/set/remove/clear)
|
|
181
|
-
- `owner_receive`: Owner fund extraction
|
|
182
|
-
|
|
183
|
-
#### treasury — Team Fund
|
|
184
|
-
|
|
185
|
-
**Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_treasury" })`
|
|
186
|
-
|
|
187
|
-
**Key Fields**:
|
|
188
|
-
- `object`: TypedPermissionObject
|
|
189
|
-
- `description`: Treasury description
|
|
190
|
-
- `receive`: Received balance
|
|
191
|
-
- `deposit`: Deposit configuration
|
|
192
|
-
- `withdraw`: Withdraw configuration
|
|
193
|
-
- `external_deposit_guard`: External deposit guards
|
|
194
|
-
- `external_withdraw_guard`: External withdraw guards
|
|
195
|
-
- `owner_receive`: Owner fund extraction
|
|
196
|
-
- `um`: Contact object ID
|
|
197
|
-
|
|
198
|
-
#### reward — Incentive Pool
|
|
199
|
-
|
|
200
|
-
**Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_reward" })`
|
|
201
|
-
|
|
202
|
-
**Key Fields**:
|
|
203
|
-
- `object`: TypedPermissionObject
|
|
204
|
-
- `claim`: Guard ID for claim verification
|
|
205
|
-
- `description`: Reward description
|
|
206
|
-
- `coin_add`: Coin to add
|
|
207
|
-
- `receive`: Received balance
|
|
208
|
-
- `guard_add`: Guards for reward distribution
|
|
209
|
-
- `guard_remove_expired`: Remove expired guards flag
|
|
210
|
-
- `guard_expiration_time`: Guard expiration time
|
|
211
|
-
- `owner_receive`: Owner fund extraction
|
|
212
|
-
- `um`: Contact object ID
|
|
213
|
-
|
|
214
|
-
#### allocation — Auto-Distribution
|
|
215
|
-
|
|
216
|
-
**Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_allocation" })`
|
|
217
|
-
|
|
218
|
-
**Two Modes**:
|
|
219
|
-
|
|
220
|
-
**MODE 1: CREATE new Allocation**
|
|
221
|
-
- `object`: Object with name, tags, onChain, replaceExistName, type_parameter
|
|
222
|
-
- `allocators`: Allocator configuration
|
|
223
|
-
- `coin`: Coin parameter
|
|
224
|
-
- `payment_info`: Payment info
|
|
225
|
-
|
|
226
|
-
**MODE 2: OPERATE existing Allocation**
|
|
227
|
-
- `object`: Allocation ID or name (STRING)
|
|
228
|
-
- `received_coins`: Received balance
|
|
229
|
-
- `alloc_by_guard`: Guard for allocation
|
|
230
|
-
|
|
231
|
-
#### permission — Access Control
|
|
232
|
-
|
|
233
|
-
**Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_permission" })`
|
|
234
|
-
|
|
235
|
-
**Key Fields**:
|
|
236
|
-
- `object`: WithPermissionObject
|
|
237
|
-
- `description`: Permission description
|
|
238
|
-
- `policy_add`: Add policies
|
|
239
|
-
- `policy_remove`: Remove policies
|
|
240
|
-
- `policy_clear`: Clear all policies
|
|
241
|
-
- `owner_receive`: Owner fund extraction
|
|
242
|
-
- `um`: Contact object ID
|
|
243
|
-
|
|
244
|
-
#### guard — Programmable Validation
|
|
245
|
-
|
|
246
|
-
**Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_guard" })`
|
|
247
|
-
|
|
248
|
-
**Key Fields**:
|
|
249
|
-
- `namedNew`: Named object options
|
|
250
|
-
- `description`: Guard description
|
|
251
|
-
- `table`: Data table array with identifier, b_submission, value_type, value, name
|
|
252
|
-
- `root`: Computational tree — either inline node or file reference
|
|
253
|
-
- `type: "node"`: Inline GuardNode
|
|
254
|
-
- `type: "file"`: Load from file
|
|
255
|
-
- `rely`: Dependencies on other Guards
|
|
256
|
-
|
|
257
|
-
See [wowok-guard](../wowok-guard/SKILL.md) skill for complete GuardNode reference.
|
|
258
|
-
|
|
259
|
-
#### personal — On-Chain Public Identity
|
|
26
|
+
## Core Patterns
|
|
260
27
|
|
|
261
|
-
|
|
28
|
+
### Standard Structure
|
|
262
29
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
#### payment — Irreversible Coin Transfer
|
|
272
|
-
|
|
273
|
-
**Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_payment" })`
|
|
274
|
-
|
|
275
|
-
**Key Fields**:
|
|
276
|
-
- `object`: Named object options
|
|
277
|
-
- `revenue`: Revenue recipients array
|
|
278
|
-
- `info`: Payment info (remark, index)
|
|
279
|
-
|
|
280
|
-
⚠️ CRITICAL: Payment is IRREVERSIBLE. Always confirm recipient, amount, and token type before executing.
|
|
281
|
-
|
|
282
|
-
#### demand — Service Request
|
|
283
|
-
|
|
284
|
-
**Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_demand" })`
|
|
285
|
-
|
|
286
|
-
**Key Fields**:
|
|
287
|
-
- `object`: WithPermissionObject
|
|
288
|
-
- `present`: Present configuration
|
|
289
|
-
- `description`: Demand description
|
|
290
|
-
- `location`: Location
|
|
291
|
-
- `rewards`: Reward objects
|
|
292
|
-
- `guards`: Guards configuration
|
|
293
|
-
- `feedback`: Feedback entries
|
|
294
|
-
- `owner_receive`: Owner fund extraction
|
|
295
|
-
- `um`: Contact object ID
|
|
296
|
-
|
|
297
|
-
#### order — Order Lifecycle
|
|
298
|
-
|
|
299
|
-
**Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_order" })`
|
|
300
|
-
|
|
301
|
-
**Key Fields**:
|
|
302
|
-
- `object`: Order ID or name
|
|
303
|
-
- `agents`: Agent addresses
|
|
304
|
-
- `required_info`: Required info field
|
|
305
|
-
- `progress`: Progress advancement
|
|
306
|
-
- `arb_confirm`: Arbitration confirmation
|
|
307
|
-
- `arb_objection`: Arbitration objection
|
|
308
|
-
- `arb_claim_compensation`: Claim compensation
|
|
309
|
-
- `receive`: Receive funds
|
|
310
|
-
- `transfer_to`: Transfer order to new owner
|
|
311
|
-
|
|
312
|
-
#### gen_passport — Immutable Credential
|
|
313
|
-
|
|
314
|
-
**Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_gen_passport" })`
|
|
315
|
-
|
|
316
|
-
**Key Fields**:
|
|
317
|
-
- `guard`: Guard ID(s) — single string or array of strings
|
|
318
|
-
- `info`: Submission call info
|
|
319
|
-
|
|
320
|
-
**Features:**
|
|
321
|
-
- **Single Guard**: Pass a single guard ID or name as a string
|
|
322
|
-
- **Multiple Guards**: Pass an array of guard IDs or names to verify multiple guards at once
|
|
323
|
-
- **Name Resolution**: Supports both guard addresses and LocalMark names
|
|
324
|
-
|
|
325
|
-
### Common Sub-Types
|
|
326
|
-
|
|
327
|
-
**TypedPermissionObject**: STRING (existing) or OBJECT `{ name, permission, tags?, onChain?, replaceExistName?, type_parameter? }`
|
|
328
|
-
|
|
329
|
-
**WithPermissionObject**: Same as TypedPermissionObject but WITHOUT `type_parameter`
|
|
330
|
-
|
|
331
|
-
**SubmissionCall** (for execution):
|
|
332
|
-
- `sender`: string
|
|
333
|
-
- `gas_budget`: string
|
|
334
|
-
- Additional network/execution params
|
|
335
|
-
|
|
336
|
-
**CoinParam**: `number` (raw) or `string` (e.g., "2WOW", "100USDT")
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"operation_type": "<one of 16 types>",
|
|
33
|
+
"data": { /* type-specific */ },
|
|
34
|
+
"env": { "account": "", "network": "testnet" },
|
|
35
|
+
"submission": { /* Guard submission if needed */ }
|
|
36
|
+
}
|
|
37
|
+
```
|
|
337
38
|
|
|
338
|
-
**
|
|
39
|
+
**Exceptions** (no `data` wrapper):
|
|
40
|
+
- `gen_passport`: `{ guard, info?, env? }`
|
|
41
|
+
- `guard`, `payment`, `personal`: flat structure
|
|
339
42
|
|
|
340
|
-
|
|
43
|
+
### CREATE vs MODIFY Pattern
|
|
341
44
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
**
|
|
345
|
-
|
|
346
|
-
**Schema Reference**: `schema_query({ action: "get", name: "query_toolkit" })`
|
|
347
|
-
|
|
348
|
-
### 8 query_types
|
|
349
|
-
|
|
350
|
-
#### local_mark_list
|
|
351
|
-
- `query_type`: "local_mark_list"
|
|
352
|
-
- `network`: Optional network
|
|
353
|
-
- Returns: list of local name→address mappings
|
|
354
|
-
|
|
355
|
-
#### account_list
|
|
356
|
-
- `query_type`: "account_list"
|
|
357
|
-
- Returns: list of local accounts
|
|
358
|
-
|
|
359
|
-
#### local_info_list
|
|
360
|
-
- `query_type`: "local_info_list"
|
|
361
|
-
- `network`: Optional network
|
|
362
|
-
- Returns: local private data entries
|
|
363
|
-
|
|
364
|
-
#### token_list
|
|
365
|
-
- `query_type`: "token_list"
|
|
366
|
-
- `network`: Optional network
|
|
367
|
-
- Returns: available token types with precision info
|
|
368
|
-
|
|
369
|
-
#### account_balance
|
|
370
|
-
- `query_type`: "account_balance"
|
|
371
|
-
- `address`: Account address
|
|
372
|
-
- `token_type`: Optional token type
|
|
373
|
-
- `network`: Optional network
|
|
374
|
-
- Returns: account token balance
|
|
375
|
-
|
|
376
|
-
#### onchain_personal_profile
|
|
377
|
-
- `query_type`: "onchain_personal_profile"
|
|
378
|
-
- `address`: Account address
|
|
379
|
-
- `network`: Optional network
|
|
380
|
-
- `no_cache`: Optional flag
|
|
381
|
-
- Returns: on-chain public profile
|
|
382
|
-
|
|
383
|
-
#### onchain_objects
|
|
384
|
-
- `query_type`: "onchain_objects"
|
|
385
|
-
- `address`: Optional address
|
|
386
|
-
- `name_or_address`: Optional name or address
|
|
387
|
-
- `network`: Optional network
|
|
388
|
-
- `no_cache`: Optional flag
|
|
389
|
-
- Returns: on-chain objects owned by address
|
|
390
|
-
|
|
391
|
-
#### onchain_received
|
|
392
|
-
- `query_type`: "onchain_received"
|
|
393
|
-
- `name_or_address`: Name or address
|
|
394
|
-
- `all_type`: Optional boolean
|
|
395
|
-
- `cursor`: Optional cursor
|
|
396
|
-
- `limit`: Optional limit
|
|
397
|
-
- `no_cache`: Optional flag
|
|
398
|
-
- `network`: Optional network
|
|
399
|
-
- Returns: received CoinWrapper objects
|
|
45
|
+
| Format | Meaning | Example |
|
|
46
|
+
|--------|---------|---------|
|
|
47
|
+
| **String** | Reference EXISTING | `"my-service"` or `"0x1234..."` |
|
|
48
|
+
| **Object** | CREATE NEW | `{ name: "my-service", permission: "..." }` |
|
|
400
49
|
|
|
401
50
|
---
|
|
402
51
|
|
|
403
|
-
##
|
|
404
|
-
|
|
405
|
-
**MCP Input**: `{ query_type: string, parent: string, ... }` — 12 query_types
|
|
406
|
-
|
|
407
|
-
**Schema Reference**: `schema_query({ action: "get", name: "onchain_table_data" })`
|
|
408
|
-
|
|
409
|
-
| query_type | Parent | Key | Returns |
|
|
410
|
-
|------------|--------|-----|---------|
|
|
411
|
-
| `onchain_table` | any object | — (paginated cursor) | TableAnswer |
|
|
412
|
-
| `onchain_table_item_repository_data` | Repository | name + entity | entry record |
|
|
413
|
-
| `onchain_table_item_permission_perm` | Permission | address | perm entry |
|
|
414
|
-
| `onchain_table_item_entity_registrar` | Registrar | address | registrar record |
|
|
415
|
-
| `onchain_table_item_entity_linker` | Linker | entity + who | linker entry |
|
|
416
|
-
| `onchain_table_item_reward_record` | Reward | address | claim record |
|
|
417
|
-
| `onchain_table_item_demand_presenter` | Demand | address | presenter info |
|
|
418
|
-
| `onchain_table_item_treasury_history` | Treasury | address (payment) | history entry |
|
|
419
|
-
| `onchain_table_item_machine_node` | Machine | u64 (index) | node definition |
|
|
420
|
-
| `onchain_table_item_progress_history` | Progress | u64 (index) | history entry |
|
|
421
|
-
| `onchain_table_item_address_mark` | AddressMark | address | public mark |
|
|
422
|
-
| `onchain_table_item_generic` | any object | key_type + key_value | ObjectBase |
|
|
52
|
+
## The 13 Tools
|
|
423
53
|
|
|
424
|
-
|
|
54
|
+
| Tool | Purpose | Key Pattern |
|
|
55
|
+
|------|---------|-------------|
|
|
56
|
+
| `onchain_operations` | Write state (16 types) | Discriminated by `operation_type` |
|
|
57
|
+
| `query_toolkit` | Read on-chain data | 8 query types |
|
|
58
|
+
| `onchain_table_data` | Query sub-items | Dynamic field access |
|
|
59
|
+
| `account_operation` | Wallet management | 100% local |
|
|
60
|
+
| `local_mark_operation` | Name→address mappings | 100% local |
|
|
61
|
+
| `local_info_operation` | Private data store | 100% local |
|
|
62
|
+
| `messenger_operation` | Encrypted messaging | Hybrid (see messenger skill) |
|
|
63
|
+
| `wip_file` | Witness promise files | Generate/verify/sign |
|
|
64
|
+
| `guard2file` | Export Guard definition | Read-only |
|
|
65
|
+
| `machineNode2file` | Export Machine nodes | Read-only |
|
|
66
|
+
| `onchain_events` | Watch events | Paginated |
|
|
67
|
+
| `wowok_buildin_info` | Protocol constants | Reference data |
|
|
68
|
+
| `documents_and_learn` | Documentation URLs | Learning resources |
|
|
425
69
|
|
|
426
70
|
---
|
|
427
71
|
|
|
428
|
-
##
|
|
72
|
+
## Critical Patterns by Operation
|
|
429
73
|
|
|
430
|
-
|
|
74
|
+
### service — Business Listing
|
|
431
75
|
|
|
432
|
-
**
|
|
76
|
+
**Immutable After Publish**: `machine`, `order_allocators`
|
|
77
|
+
**Mutable Always**: `sales`, `discount`, `description`, `location`
|
|
78
|
+
**Add-Only After Publish**: `rewards`, `arbitrations`
|
|
433
79
|
|
|
434
|
-
|
|
80
|
+
**Common Pitfall**: Forgetting `publish: true` leaves machine/allocators changeable — risky for production.
|
|
435
81
|
|
|
436
|
-
|
|
82
|
+
### machine — Workflow Template
|
|
437
83
|
|
|
438
|
-
|
|
84
|
+
**Key Insight**: Machine defines WHO can advance (via `namedOperator`). Empty string = Order-operable; non-empty = requires Permission.
|
|
439
85
|
|
|
440
|
-
|
|
86
|
+
**Publish Effect**: Makes nodes immutable. Essential before Service references it.
|
|
441
87
|
|
|
442
|
-
|
|
88
|
+
### progress — Advancement
|
|
443
89
|
|
|
444
|
-
**
|
|
90
|
+
**Dual Paths**:
|
|
91
|
+
- `node`: Single step
|
|
92
|
+
- `nodes`: Multi-step array
|
|
445
93
|
|
|
446
|
-
|
|
447
|
-
- `add`: Add marks with `{ marks: { name, address, tags? }[], network? }`
|
|
448
|
-
- `remove`: Remove marks with `{ marks: { name }[], network? }`
|
|
449
|
-
- `clear`: Clear all with `{ network? }`
|
|
94
|
+
**Guard Integration**: Forward transitions may require Guard validation — see [wowok-machine](../wowok-machine/SKILL.md).
|
|
450
95
|
|
|
451
|
-
|
|
96
|
+
### guard — Immutable Validation
|
|
452
97
|
|
|
453
|
-
|
|
98
|
+
**CRITICAL**: Guards are CREATE-ONLY. No modification after deployment.
|
|
454
99
|
|
|
455
|
-
**
|
|
100
|
+
**Update Strategy**: `guard2file` → modify locally → create new Guard → update all references.
|
|
456
101
|
|
|
457
|
-
|
|
102
|
+
See [wowok-guard](../wowok-guard/SKILL.md) for complete GuardNode reference and design patterns.
|
|
458
103
|
|
|
459
|
-
|
|
104
|
+
### order — Customer Operations
|
|
460
105
|
|
|
461
|
-
|
|
106
|
+
**Key Distinction**: Order is builder-owned; agents can operate but **CANNOT withdraw**.
|
|
462
107
|
|
|
463
|
-
|
|
108
|
+
**Arbitration Flow**: `arb_confirm` → `arb_objection` → `arb_claim_compensation` (all via Order)
|
|
464
109
|
|
|
465
|
-
|
|
110
|
+
See [wowok-order](../wowok-order/SKILL.md) for customer-side arbitration operations.
|
|
466
111
|
|
|
467
|
-
|
|
112
|
+
### gen_passport — Credential Generation
|
|
468
113
|
|
|
469
|
-
|
|
114
|
+
**Single or Multiple**: One Guard (string) or multiple Guards (array)
|
|
470
115
|
|
|
471
|
-
|
|
116
|
+
**Use Case**: Off-chain permission verification, voting eligibility, access control.
|
|
472
117
|
|
|
473
118
|
---
|
|
474
119
|
|
|
475
|
-
##
|
|
120
|
+
## Common Pitfalls
|
|
476
121
|
|
|
477
|
-
###
|
|
122
|
+
### 1. Wrong Discriminated Union Branch
|
|
478
123
|
|
|
479
|
-
**
|
|
124
|
+
**Symptom**: "Invalid data structure" errors
|
|
125
|
+
**Cause**: Using `service` schema for `order` operation
|
|
126
|
+
**Fix**: Match `operation_type` exactly to schema
|
|
480
127
|
|
|
481
|
-
|
|
128
|
+
### 2. CREATE vs MODIFY Confusion
|
|
482
129
|
|
|
483
|
-
|
|
130
|
+
**Symptom**: Creates duplicate objects instead of modifying
|
|
131
|
+
**Cause**: Passing object shape when string reference intended
|
|
132
|
+
**Fix**: String = existing, Object = new
|
|
484
133
|
|
|
485
|
-
|
|
134
|
+
### 3. Missing submission Field
|
|
486
135
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
136
|
+
**Symptom**: Guard validation fails with "missing submission"
|
|
137
|
+
**Cause**: Guard requires user data but `submission` omitted
|
|
138
|
+
**Fix**: Add `submission: { sender, info }` after first call fails
|
|
490
139
|
|
|
491
|
-
###
|
|
140
|
+
### 4. Immutable Field After Publish
|
|
492
141
|
|
|
493
|
-
**
|
|
142
|
+
**Symptom**: "Cannot modify published field" error
|
|
143
|
+
**Cause**: Attempting to change `machine` or `order_allocators` after `publish: true`
|
|
144
|
+
**Fix**: Create new Service with corrected fields
|
|
494
145
|
|
|
495
|
-
|
|
496
|
-
- `file_path`: Output file path
|
|
497
|
-
- `format`: "json" or "markdown"
|
|
146
|
+
### 5. Wrong Tool Selection
|
|
498
147
|
|
|
499
|
-
|
|
148
|
+
| Task | Wrong Tool | Correct Tool |
|
|
149
|
+
|------|-----------|--------------|
|
|
150
|
+
| Query object state | `onchain_operations` | `query_toolkit` |
|
|
151
|
+
| Send message | `onchain_operations` | `messenger_operation` |
|
|
152
|
+
| Check name availability | `query_toolkit` | `local_mark_operation` |
|
|
153
|
+
| Export Guard logic | `query_toolkit` | `guard2file` |
|
|
500
154
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
- `type`: Event type
|
|
504
|
-
- `cursor`: Optional cursor
|
|
505
|
-
- `limit`: Optional limit
|
|
155
|
+
---
|
|
506
156
|
|
|
507
|
-
|
|
157
|
+
## Troubleshooting Guide
|
|
508
158
|
|
|
509
|
-
|
|
159
|
+
### "Schema not found"
|
|
510
160
|
|
|
511
|
-
|
|
161
|
+
**Action**: `schema_query({ action: "get", name: "<tool_name>" })`
|
|
512
162
|
|
|
513
|
-
###
|
|
163
|
+
### "Invalid parameter format"
|
|
514
164
|
|
|
515
|
-
**
|
|
165
|
+
**Checklist**:
|
|
166
|
+
1. Correct `operation_type`?
|
|
167
|
+
2. CREATE vs MODIFY format correct?
|
|
168
|
+
3. Required fields present?
|
|
169
|
+
4. `submission` needed for Guard?
|
|
516
170
|
|
|
517
|
-
|
|
171
|
+
### "Permission denied"
|
|
518
172
|
|
|
519
|
-
|
|
173
|
+
**Causes**:
|
|
174
|
+
- Not object owner
|
|
175
|
+
- Missing Permission reference
|
|
176
|
+
- Guard validation failed
|
|
520
177
|
|
|
521
|
-
|
|
178
|
+
### Tool-Specific Errors
|
|
522
179
|
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
│ ├─ Local accounts/marks/info/tokens → query_toolkit
|
|
531
|
-
│ ├─ On-chain objects/profile → query_toolkit (onchain_objects / onchain_personal_profile)
|
|
532
|
-
│ ├─ Account balance → query_toolkit (account_balance)
|
|
533
|
-
│ ├─ Table sub-items → onchain_table_data
|
|
534
|
-
│ ├─ Received payments → query_toolkit (onchain_received)
|
|
535
|
-
│ └─ On-chain events → onchain_events
|
|
536
|
-
│
|
|
537
|
-
├─ MANAGE local data
|
|
538
|
-
│ ├─ Accounts → account_operation
|
|
539
|
-
│ ├─ Address book → local_mark_operation
|
|
540
|
-
│ └─ Private info → local_info_operation
|
|
541
|
-
│
|
|
542
|
-
├─ COMMUNICATE → messenger_operation
|
|
543
|
-
├─ PROMISES (WIP) → wip_file
|
|
544
|
-
├─ EXPORT definitions → guard2file / machineNode2file
|
|
545
|
-
├─ LEARN protocol → wowok_buildin_info
|
|
546
|
-
└─ DOCUMENTATION → documents_and_learn
|
|
547
|
-
```
|
|
180
|
+
| Error | Likely Cause | Solution |
|
|
181
|
+
|-------|-------------|----------|
|
|
182
|
+
| "Object not found" | Wrong address or not created | Verify with `query_toolkit` |
|
|
183
|
+
| "Name already exists" | `replaceExistName: false` | Set `replaceExistName: true` or choose new name |
|
|
184
|
+
| "Guard validation failed" | Missing/incorrect `submission` | Add proper `submission` field |
|
|
185
|
+
| "Insufficient balance" | Account lacks funds | Check with `account_operation` |
|
|
186
|
+
| "Deadline passed" | Timestamp in past | Use future timestamp |
|
|
548
187
|
|
|
549
188
|
---
|
|
550
189
|
|
|
551
|
-
##
|
|
552
|
-
|
|
553
|
-
### Query-First Pattern (ALWAYS before writes)
|
|
554
|
-
|
|
555
|
-
```
|
|
556
|
-
1. query_toolkit (account_list) → Which accounts exist?
|
|
557
|
-
2. query_toolkit (local_mark_list) → What named addresses exist?
|
|
558
|
-
3. query_toolkit (onchain_objects) → What's already on-chain?
|
|
559
|
-
4. wowok_buildin_info → Protocol constants/permissions
|
|
560
|
-
```
|
|
561
|
-
|
|
562
|
-
### Dry-Run Pattern (ALWAYS for writes)
|
|
190
|
+
## Schema Access
|
|
563
191
|
|
|
564
|
-
```
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
192
|
+
```javascript
|
|
193
|
+
// Get any tool schema
|
|
194
|
+
schema_query({ action: "get", name: "onchain_operations" })
|
|
195
|
+
schema_query({ action: "get", name: "query_toolkit" })
|
|
196
|
+
schema_query({ action: "get", name: "messenger_operation" })
|
|
197
|
+
// ... etc for all 13 tools
|
|
568
198
|
```
|
|
569
199
|
|
|
570
200
|
---
|
|
571
201
|
|
|
572
|
-
##
|
|
202
|
+
## Design Principles
|
|
573
203
|
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
| "table field required" | Missing Guard table | Guards MUST have `table` array |
|
|
580
|
-
| "dependency not found" | Build order | Build dependencies before dependents |
|
|
581
|
-
| "invalid parameter" | Wrong format | Check discriminated union branch |
|
|
582
|
-
| submission parameter errors | Didn't check schema | Verify all submission fields |
|
|
204
|
+
1. **Immutability First**: Guards, published Machines — design carefully, no updates
|
|
205
|
+
2. **Explicit Over Implicit**: Always specify `operation_type`, never rely on defaults
|
|
206
|
+
3. **Validate Before Execute**: Use `query_toolkit` to check state before operations
|
|
207
|
+
4. **Local for Private**: Sensitive data → `local_info_operation`, never on-chain
|
|
208
|
+
5. **Schema as Source**: When in doubt, query schema — don't guess parameter formats
|
|
583
209
|
|
|
584
210
|
---
|
|
585
211
|
|
|
586
|
-
##
|
|
587
|
-
|
|
588
|
-
Use the `schema_query` MCP tool to retrieve complete JSON schemas for any WoWok tool or operation. This is the **authoritative source** — returns schemas directly from the MCP server with all properties, types, and descriptions.
|
|
589
|
-
|
|
590
|
-
### Usage Examples
|
|
591
|
-
|
|
592
|
-
**List all available schemas:**
|
|
593
|
-
```
|
|
594
|
-
schema_query({ action: "list" })
|
|
595
|
-
```
|
|
596
|
-
|
|
597
|
-
**Get a specific tool schema:**
|
|
598
|
-
```
|
|
599
|
-
schema_query({ action: "get", name: "onchain_operations" })
|
|
600
|
-
schema_query({ action: "get", name: "onchain_operations_service" })
|
|
601
|
-
schema_query({ action: "get", name: "query_toolkit" })
|
|
602
|
-
```
|
|
603
|
-
|
|
604
|
-
**Search schemas by keyword:**
|
|
605
|
-
```
|
|
606
|
-
schema_query({ action: "search", query: "guard" })
|
|
607
|
-
```
|
|
212
|
+
## Quick Decision Tree
|
|
608
213
|
|
|
609
|
-
**List all on-chain operation types:**
|
|
610
214
|
```
|
|
611
|
-
|
|
215
|
+
Need to change on-chain state?
|
|
216
|
+
├── YES → onchain_operations
|
|
217
|
+
│ └── Which type? (service, machine, order, guard, etc.)
|
|
218
|
+
├── NO, just query → query_toolkit
|
|
219
|
+
│ └── Object state or table data?
|
|
220
|
+
├── NO, communicate → messenger_operation
|
|
221
|
+
├── NO, manage wallet → account_operation
|
|
222
|
+
└── NO, export definition → guard2file / machineNode2file
|
|
612
223
|
```
|
|
613
|
-
|
|
614
|
-
### Available Schema Names
|
|
615
|
-
|
|
616
|
-
**Main Tools:** `onchain_operations`, `query_toolkit`, `onchain_table_data`, `onchain_events`, `account_operation`, `local_mark_operation`, `local_info_operation`, `messenger_operation`, `wip_file`, `guard2file`, `machineNode2file`, `wowok_buildin_info`, `schema_query`
|
|
617
|
-
|
|
618
|
-
**Individual Operations:** `onchain_operations_service`, `onchain_operations_machine`, `onchain_operations_order`, `onchain_operations_progress`, `onchain_operations_guard`, `onchain_operations_permission`, `onchain_operations_arbitration`, `onchain_operations_repository`, `onchain_operations_contact`, `onchain_operations_treasury`, `onchain_operations_reward`, `onchain_operations_allocation`, `onchain_operations_personal`, `onchain_operations_payment`, `onchain_operations_demand`, `onchain_operations_gen_passport`
|
|
619
|
-
|
|
620
|
-
**When to use**: Always call `schema_query` before using complex tools like `onchain_operations` — the discriminated unions have 16 branches with 5-6 levels of nesting, and one wrong field name causes immediate failure. Use `action: "get"` with the specific operation name (e.g., `onchain_operations_service`) when you need the complete structure for a single operation type.
|