@wowok/agent-mcp 2.2.11 → 2.2.13

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 (93) hide show
  1. package/dist/docs/index.d.ts +3 -0
  2. package/dist/docs/index.js +2 -0
  3. package/dist/docs/loader.d.ts +12 -0
  4. package/dist/docs/loader.js +177 -0
  5. package/dist/docs/search.d.ts +17 -0
  6. package/dist/docs/search.js +325 -0
  7. package/dist/docs/types.d.ts +55 -0
  8. package/dist/docs/types.js +1 -0
  9. package/dist/index.d.ts +12 -0
  10. package/dist/index.js +146 -39
  11. package/docs/README.md +249 -0
  12. package/docs/WIP.md +388 -0
  13. package/docs/WTS.md +536 -0
  14. package/docs/docs/account.md +914 -0
  15. package/docs/docs/allocation.md +635 -0
  16. package/docs/docs/arbitration.md +1804 -0
  17. package/docs/docs/arbitration_state_machine.md +270 -0
  18. package/docs/docs/contact.md +709 -0
  19. package/docs/docs/demand.md +948 -0
  20. package/docs/docs/guard.md +1465 -0
  21. package/docs/docs/localinfo.md +432 -0
  22. package/docs/docs/localmark.md +583 -0
  23. package/docs/docs/machine.md +2490 -0
  24. package/docs/docs/messenger.md +2098 -0
  25. package/docs/docs/onchain_events.md +267 -0
  26. package/docs/docs/order.md +1001 -0
  27. package/docs/docs/payment.md +512 -0
  28. package/docs/docs/permission.md +1438 -0
  29. package/docs/docs/personal.md +742 -0
  30. package/docs/docs/progress.md +1748 -0
  31. package/docs/docs/query.md +467 -0
  32. package/docs/docs/repository.md +1043 -0
  33. package/docs/docs/reward.md +833 -0
  34. package/docs/docs/service.md +2130 -0
  35. package/docs/docs/stage-01-introduction.md +243 -0
  36. package/docs/docs/stage-02-trust.md +302 -0
  37. package/docs/docs/stage-03-collaboration.md +337 -0
  38. package/docs/docs/stage-04-transaction.md +277 -0
  39. package/docs/docs/stage-05-business.md +151 -0
  40. package/docs/docs/stage-06-personal.md +203 -0
  41. package/docs/docs/stage-07-query.md +572 -0
  42. package/docs/docs/stage-08-examples.md +184 -0
  43. package/docs/docs/treasury.md +1149 -0
  44. package/docs/docs/wowok_buildin_info.md +740 -0
  45. package/docs/examples/Insurance/Insurance.md +594 -0
  46. package/docs/examples/Insurance/Insurance_TestResults.md +481 -0
  47. package/docs/examples/Insurance/insurance_complete_guard_v1.json +50 -0
  48. package/docs/examples/MyShop/MyShop.md +1353 -0
  49. package/docs/examples/MyShop/MyShop_TestResults.md +1003 -0
  50. package/docs/examples/MyShop_Advanced/MyShop_Advanced.md +1898 -0
  51. package/docs/examples/MyShop_Advanced/MyShop_Advanced_MerchantSystem_TestResults.md +1297 -0
  52. package/docs/examples/MyShop_Advanced/MyShop_Advanced_OrderFlow_TestResults.md +743 -0
  53. package/docs/examples/MyShop_Advanced/machine_nodes.json +222 -0
  54. package/docs/examples/ThreeBody_Signature/ThreeBody_Signature.md +776 -0
  55. package/docs/examples/ThreeBody_Signature/ThreeBody_Signature_TestResults.md +599 -0
  56. package/docs/examples/Travel/Travel.md +1157 -0
  57. package/docs/examples/Travel/Travel_TestResults.md +743 -0
  58. package/docs/examples/Travel/calc-weather-timestamps.js +8 -0
  59. package/docs/examples/Travel/travel_machine_v2_export.json +104 -0
  60. package/docs/examples/Travel/weather_check_guard_v1.json +51 -0
  61. package/docs/skills/WOWOK.md +650 -0
  62. package/docs/skills/onchain_operations/_common.md +406 -0
  63. package/docs/skills/onchain_operations/_index.md +196 -0
  64. package/docs/skills/onchain_operations/allocation.md +28 -0
  65. package/docs/skills/onchain_operations/arbitration.md +106 -0
  66. package/docs/skills/onchain_operations/contact.md +40 -0
  67. package/docs/skills/onchain_operations/demand.md +53 -0
  68. package/docs/skills/onchain_operations/gen_passport.md +23 -0
  69. package/docs/skills/onchain_operations/guard.md +56 -0
  70. package/docs/skills/onchain_operations/machine.md +89 -0
  71. package/docs/skills/onchain_operations/order.md +56 -0
  72. package/docs/skills/onchain_operations/payment.md +24 -0
  73. package/docs/skills/onchain_operations/permission.md +68 -0
  74. package/docs/skills/onchain_operations/personal.md +58 -0
  75. package/docs/skills/onchain_operations/progress.md +38 -0
  76. package/docs/skills/onchain_operations/repository.md +70 -0
  77. package/docs/skills/onchain_operations/reward.md +38 -0
  78. package/docs/skills/onchain_operations/service.md +78 -0
  79. package/docs/skills/onchain_operations/treasury.md +68 -0
  80. package/docs/skills/schema-account_operation.md +402 -0
  81. package/docs/skills/schema-guard2file.md +153 -0
  82. package/docs/skills/schema-local_info_operation.md +160 -0
  83. package/docs/skills/schema-local_mark_operation.md +148 -0
  84. package/docs/skills/schema-machineNode2file.md +155 -0
  85. package/docs/skills/schema-messenger_operation.md +547 -0
  86. package/docs/skills/schema-onchain_events.md +201 -0
  87. package/docs/skills/schema-onchain_table_data.md +334 -0
  88. package/docs/skills/schema-query_toolkit.md +395 -0
  89. package/docs/skills/schema-wip_file.md +240 -0
  90. package/docs/skills/schema-wowok_buildin_info.md +296 -0
  91. package/docs/wip-examples/three_body.html +57 -0
  92. package/docs/wip-examples/three_body.wip +30 -0
  93. package/package.json +3 -2
@@ -0,0 +1,572 @@
1
+ # Stage 7: Data Query 🔍
2
+
3
+ ---
4
+
5
+ **[← Stage 6: Personal Services](stage-06-personal.md) | [Stage 8: Practical Examples →](stage-08-examples.md)**
6
+
7
+ ---
8
+
9
+ ## 🎯 Stage Objectives
10
+
11
+ In this stage, you will learn about data queries in WoWok, including:
12
+
13
+ - How to use **query_toolkit** to query local and on-chain data
14
+ - How to use **onchain_events** to query on-chain events
15
+ - How to use **wowok_buildin_info** to query protocol information
16
+ - How to use **documents_and_learn** to get documentation and learning resources
17
+ - How to query Messenger messages via **messenger_operation**
18
+
19
+ ---
20
+
21
+ ## 📚 Learning Content
22
+
23
+ ### 7.1 Query Tools Overview
24
+
25
+ WoWok provides five specialized query tools:
26
+
27
+ | Tool Name | Purpose | Main Functions |
28
+ |---------|------|---------|
29
+ | **query_toolkit** | General data query | Local data, on-chain objects, balances, profiles, received assets |
30
+ | **onchain_table_data** | Dynamic table data query | Object dynamic fields tables, table items (permission, repository, reward, etc.) |
31
+ | **onchain_events** | On-chain event query | Arbitration events, order events, progress events, etc. |
32
+ | **wowok_buildin_info** | Protocol information query | Constants, permissions, Guard instructions, network info, etc. |
33
+ | **documents_and_learn** | Documentation and learning resources | Get official documentation URLs for users and AI to get help |
34
+
35
+ **⚠️ Important Note**: Messenger message queries do not go through the above tools; you need to use the **messenger_operation** tool with the appropriate parameters.
36
+
37
+ ---
38
+
39
+ ### 7.2 query_toolkit (Data Query Toolkit 🔍)
40
+
41
+ **Why do we need query_toolkit?**
42
+
43
+ query_toolkit is WoWok's core query tool, capable of querying data on local devices and various data on the blockchain.
44
+
45
+ **Supported Query Types:**
46
+
47
+ **Local Queries:**
48
+ - 👤 `account_list` — Query your LOCAL accounts (addresses, public keys, messenger status)
49
+ - 📇 `local_mark_list` — Query your LOCAL address book (name→address mappings with tags)
50
+ - 📝 `local_info_list` — Query your LOCAL private info (delivery addresses, phone numbers, contacts)
51
+ - 🏷️ `local_names` — Query LOCAL names by a list of addresses (returns resolved account and mark names)
52
+ - 💎 `token_list` — Query cached token metadata (symbol, decimals, icon URL)
53
+ - 💰 `account_balance` — Query account coin balance OR paginated coin objects
54
+
55
+ **On-Chain Queries:**
56
+ - 👤 `onchain_personal_profile` — Query any user's PUBLIC on-chain profile (social links, reputation, votes)
57
+ - 📦 `onchain_objects` — Batch query on-chain WOWOK objects by ID
58
+ - 📥 `onchain_received` — Query objects (payments, tokens, NFTs) received by an on-chain object
59
+
60
+ > **Note**: Dynamic table data queries (`onchain_table`, `onchain_table_item_*`) have been moved to the dedicated **`onchain_table_data`** tool. See [7.2b onchain_table_data](#72b-onchain_table_data-dynamic-table-data-query) below.
61
+
62
+ **→ [View query_toolkit Detailed Documentation →](query.md)**
63
+
64
+ **→ [View onchain_events Detailed Documentation →](onchain_events.md)**
65
+
66
+ **→ [View wowok_buildin_info Detailed Documentation →](wowok_buildin_info.md)**
67
+
68
+ ---
69
+
70
+ #### Example 1: Query Account List
71
+
72
+ Query all local accounts:
73
+
74
+ ```json
75
+ {
76
+ "query_type": "account_list"
77
+ }
78
+ ```
79
+
80
+ ---
81
+
82
+ #### Example 2: Query Account Balance
83
+
84
+ Query the WOW token balance of a specified account:
85
+
86
+ ```json
87
+ {
88
+ "query_type": "account_balance",
89
+ "name_or_address": "my_account",
90
+ "balance": true,
91
+ "token_type": "0x2::wow::WOW"
92
+ }
93
+ ```
94
+
95
+ ---
96
+
97
+ #### Example 3: Query On-Chain Objects
98
+
99
+ Query detailed information of multiple objects:
100
+
101
+ ```json
102
+ {
103
+ "query_type": "onchain_objects",
104
+ "objects": ["0x1234...abcd", "0x5678...efgh"]
105
+ }
106
+ ```
107
+
108
+ ---
109
+
110
+ ### 7.2b onchain_table_data (Dynamic Table Data Query 📊)
111
+
112
+ **Why do we need onchain_table_data?**
113
+
114
+ This tool was split from `query_toolkit` to handle the unique characteristics of dynamic table queries. On-chain objects have fixed size, but their table data (dynamic fields) can grow dynamically. The `onchain_table_data` tool is specialized for querying these dynamic tables and their items.
115
+
116
+ **Supported Query Types (12 total):**
117
+
118
+ | # | query_type | Parent Object | Key | Meaning |
119
+ |---|-----------|--------------|-----|---------|
120
+ | 1 | `onchain_table` | Any object | — | Paginated query of ANY object's dynamic fields table |
121
+ | 2 | `onchain_table_item_repository_data` | Repository | name + entity | Query a record from a Repository's key-value database |
122
+ | 3 | `onchain_table_item_permission_perm` | Permission | user/Guard address | Query permission entries from access control table |
123
+ | 4 | `onchain_table_item_entity_registrar` | System EntityRegistrar | user address | Query entity registration records |
124
+ | 5 | `onchain_table_item_entity_linker` | System EntityLinker | entity address | Query community votes/endorsements |
125
+ | 6 | `onchain_table_item_reward_record` | Reward | recipient address | Query reward claim records |
126
+ | 7 | `onchain_table_item_demand_presenter` | Demand | presenter address | Query demand submissions |
127
+ | 8 | `onchain_table_item_treasury_history` | Treasury | payment ID | Query treasury payment records |
128
+ | 9 | `onchain_table_item_machine_node` | Machine | node name | Query workflow node definitions |
129
+ | 10 | `onchain_table_item_progress_history` | Progress | sequence number | Query progress step records |
130
+ | 11 | `onchain_table_item_address_mark` | AddressMark | address | Query PUBLIC on-chain name/tag marks |
131
+ | 12 | `onchain_table_item_generic` | Any object | any key type | Query generic table item from ANY object (supports address, u64, string, object ID keys) |
132
+
133
+ **→ [View onchain_table_data Detailed Documentation →](query.md#onchain_table_data-tool)**
134
+
135
+ ---
136
+
137
+ #### Example: Query Table Data
138
+
139
+ Query the table data of a Service object with pagination:
140
+
141
+ ```json
142
+ {
143
+ "query_type": "onchain_table",
144
+ "parent": "service_object_id",
145
+ "cursor": null,
146
+ "limit": 20
147
+ }
148
+ ```
149
+
150
+ #### Example: Query Permission Perm Item
151
+
152
+ Query the permission record for a specific user:
153
+
154
+ ```json
155
+ {
156
+ "query_type": "onchain_table_item_permission_perm",
157
+ "parent": "perm_admin",
158
+ "address": "alice"
159
+ }
160
+ ```
161
+
162
+ #### Example: Query Entity Registrar Item
163
+
164
+ Query an entity's registration record:
165
+
166
+ ```json
167
+ {
168
+ "query_type": "onchain_table_item_entity_registrar",
169
+ "address": "service_provider"
170
+ }
171
+ ```
172
+
173
+ ---
174
+
175
+ ### 7.3 onchain_events (On-Chain Event Query 📅)
176
+
177
+ **Why do we need onchain_events?**
178
+
179
+ On-chain events record important activities in the WoWok ecosystem, such as order creation, arbitration initiation, progress updates, etc. By querying these events, you can:
180
+
181
+ - Track order lifecycle
182
+ - Monitor arbitration status
183
+ - Get demand feedback
184
+ - View new entity registrations
185
+
186
+ **Supported Event Types:**
187
+
188
+ | Event Type | Description |
189
+ |---------|------|
190
+ | `ArbEvent` | Arbitration events |
191
+ | `NewOrderEvent` | New order events |
192
+ | `ProgressEvent` | Progress events |
193
+ | `DemandPresentEvent` | Demand submission events |
194
+ | `DemandFeedbackEvent` | Demand feedback events |
195
+ | `NewEntityEvent` | New entity registration events |
196
+
197
+ > **Note**: Any arbitrary string('{package_address::module_name::event_name}') can also be used as an event type for custom events.
198
+
199
+ ---
200
+
201
+ #### Example 5: Query New Order Events
202
+
203
+ Query the latest new order events:
204
+
205
+ ```json
206
+ {
207
+ "type": "NewOrderEvent",
208
+ "limit": 10,
209
+ "order": "descending"
210
+ }
211
+ ```
212
+
213
+ ---
214
+
215
+ #### Example 6: Paginated Query of Arbitration Events
216
+
217
+ Use pagination cursor to query arbitration events:
218
+
219
+ ```json
220
+ {
221
+ "type": "ArbEvent",
222
+ "cursor": null,
223
+ "limit": 20,
224
+ "order": "descending",
225
+ "network": "testnet"
226
+ }
227
+ ```
228
+
229
+ **The response includes `nextCursor` for the next page query:**
230
+
231
+ ```json
232
+ {
233
+ "type": "ArbEvent",
234
+ "cursor": {
235
+ "txDigest": "0xabc...",
236
+ "eventSeq": "123"
237
+ },
238
+ "limit": 20,
239
+ "order": "descending"
240
+ }
241
+ ```
242
+
243
+ ---
244
+
245
+ ### 7.4 wowok_buildin_info (Protocol Information Query ℹ️)
246
+
247
+ **Why do we need wowok_buildin_info?**
248
+
249
+ Query WoWok protocol's built-in information, including system constants, permission definitions, Guard instructions, etc.
250
+
251
+ **Supported Information Types:**
252
+
253
+ | Information Type | Description |
254
+ |---------|------|
255
+ | `constants` | System constants |
256
+ | `built-in permissions` | Built-in permission list |
257
+ | `guard instructions` | Guard instruction list |
258
+ | `current network` | Current network entry point |
259
+ | `value types` | Supported value types |
260
+
261
+ ---
262
+
263
+ #### Example 7: Query System Constants
264
+
265
+ ```json
266
+ {
267
+ "info": "constants"
268
+ }
269
+ ```
270
+
271
+ ---
272
+
273
+ #### Example 8: Query Built-in Permissions
274
+
275
+ ```json
276
+ {
277
+ "info": "built-in permissions"
278
+ }
279
+ ```
280
+
281
+ **Permission query with filter:**
282
+
283
+ ```json
284
+ {
285
+ "info": "built-in permissions",
286
+ "filter": {
287
+ "name": "order",
288
+ "index": 300
289
+ }
290
+ }
291
+ ```
292
+
293
+ ---
294
+
295
+ #### Example 9: Query Guard Instructions
296
+
297
+ ```json
298
+ {
299
+ "info": "guard instructions"
300
+ }
301
+ ```
302
+
303
+ ---
304
+
305
+ #### Example 10: Query Current Network
306
+
307
+ ```json
308
+ {
309
+ "info": "current network"
310
+ }
311
+ ```
312
+
313
+ ---
314
+
315
+ #### Example 11: Query Value Types
316
+
317
+ ```json
318
+ {
319
+ "info": "value types"
320
+ }
321
+ ```
322
+
323
+ ---
324
+
325
+ ### 7.5 documents_and_learn (Documentation and Learning Resources 📚)
326
+
327
+ **Why do we need documents_and_learn?**
328
+
329
+ When you need to learn more about WoWok, you can use this tool to get official documentation URLs. This is useful for:
330
+
331
+ - Users who want to learn how to use WoWok
332
+ - AI that needs more context to answer user questions
333
+ - Finding detailed documentation on specific topics
334
+
335
+ **Features:**
336
+
337
+ - Provide official documentation link: `https://github.com/wowok-ai/docs#`
338
+ - Support specifying topic parameters to jump directly to relevant documentation
339
+ - Return structured documentation information
340
+
341
+ ---
342
+
343
+ #### Example 12: Get Documentation Home Page
344
+
345
+ Get the WoWok official documentation home page link:
346
+
347
+ ```json
348
+ {}
349
+ ```
350
+
351
+ Or explicitly call:
352
+
353
+ ```json
354
+ {
355
+ "topic": ""
356
+ }
357
+ ```
358
+
359
+ ---
360
+
361
+ #### Example 13: Get Documentation for Specific Topic
362
+
363
+ Get documentation link about Guard:
364
+
365
+ ```json
366
+ {
367
+ "topic": "guard"
368
+ }
369
+ ```
370
+
371
+ Get documentation link about Service:
372
+
373
+ ```json
374
+ {
375
+ "topic": "service"
376
+ }
377
+ ```
378
+
379
+ ---
380
+
381
+ ### 7.6 Messenger Message Query 💬
382
+
383
+ **⚠️ Important Note**: Messenger message queries **do not** go through `query_toolkit`; you need to use the dedicated **messenger_operation** tool.
384
+
385
+ **How to Query Messenger Messages:**
386
+
387
+ Use the `messenger_operation` tool, specifying `operation` as `"watch_messages"` or `"watch_conversations"`.
388
+
389
+ ---
390
+
391
+ #### Example 14: View Conversation List
392
+
393
+ ```json
394
+ {
395
+ "operation": "watch_conversations",
396
+ "account": "my_account"
397
+ }
398
+ ```
399
+
400
+ ---
401
+
402
+ #### Example 15: View Message History
403
+
404
+ View all messages:
405
+
406
+ ```json
407
+ {
408
+ "operation": "watch_messages"
409
+ }
410
+ ```
411
+
412
+ View messages with a specific user:
413
+
414
+ ```json
415
+ {
416
+ "operation": "watch_messages",
417
+ "filter": {
418
+ "peerAddress": {
419
+ "name_or_address": "friend_address"
420
+ }
421
+ }
422
+ }
423
+ ```
424
+
425
+ View received messages:
426
+
427
+ ```json
428
+ {
429
+ "operation": "watch_messages",
430
+ "filter": {
431
+ "direction": "received"
432
+ }
433
+ }
434
+ ```
435
+
436
+ Search by keyword:
437
+
438
+ ```json
439
+ {
440
+ "operation": "watch_messages",
441
+ "filter": {
442
+ "keyword": "hello",
443
+ "limit": 50
444
+ }
445
+ }
446
+ ```
447
+
448
+ ---
449
+
450
+ ## 🎓 Practice Exercises
451
+
452
+ ### Exercise 1: Query Local Account List
453
+
454
+ See what local accounts you have:
455
+
456
+ ```json
457
+ {
458
+ "query_type": "account_list"
459
+ }
460
+ ```
461
+
462
+ ---
463
+
464
+ ### Exercise 2: Query Account Balance
465
+
466
+ Query the WOW balance of the default account:
467
+
468
+ ```json
469
+ {
470
+ "query_type": "account_balance",
471
+ "token_type": "0x2::wow::WOW"
472
+ }
473
+ ```
474
+
475
+ ---
476
+
477
+ ### Exercise 3: Query On-Chain Events
478
+
479
+ Query the latest 10 new order events:
480
+
481
+ ```json
482
+ {
483
+ "type": "NewOrderEvent",
484
+ "limit": 10,
485
+ "order": "descending"
486
+ }
487
+ ```
488
+
489
+ ---
490
+
491
+ ### Exercise 4: Query Protocol Constants
492
+
493
+ Query WoWok protocol constants:
494
+
495
+ ```json
496
+ {
497
+ "info": "constants"
498
+ }
499
+ ```
500
+
501
+ ---
502
+
503
+ ### Exercise 5: Query Messenger Conversations
504
+
505
+ View your Messenger conversation list:
506
+
507
+ ```json
508
+ {
509
+ "operation": "watch_conversations"
510
+ }
511
+ ```
512
+
513
+ ---
514
+
515
+ ### Exercise 6: Query Object Details
516
+
517
+ Query detailed information of a Service object:
518
+
519
+ ```json
520
+ {
521
+ "query_type": "onchain_objects",
522
+ "objects": ["service_object_id"]
523
+ }
524
+ ```
525
+
526
+ ---
527
+
528
+ ### Exercise 7: Get Documentation Link
529
+
530
+ Get WoWok official documentation link:
531
+
532
+ ```json
533
+ {}
534
+ ```
535
+
536
+ Get documentation about a specific topic:
537
+
538
+ ```json
539
+ {
540
+ "topic": "guard"
541
+ }
542
+ ```
543
+
544
+ ---
545
+
546
+ ## 🏆 Stage Checklist
547
+
548
+ Congratulations on reaching the final stage! Please confirm that you have:
549
+
550
+ - [ ] Understood the differences and uses of the five query tools
551
+ - [ ] Used query_toolkit to query account list
552
+ - [ ] Used query_toolkit to query account balance
553
+ - [ ] Used onchain_table_data to query dynamic table data
554
+ - [ ] Used onchain_events to query on-chain events
555
+ - [ ] Used wowok_buildin_info to query protocol information
556
+ - [ ] Used documents_and_learn to get documentation links
557
+ - [ ] Used messenger_operation to query Messenger messages
558
+ - [ ] Understood how to query various data
559
+
560
+ ---
561
+
562
+ ## 🎉 Congratulations!
563
+
564
+ You have completed Stage 7! Now you have mastered WoWok's data query capabilities and are ready to move on to the final stage to explore practical examples!
565
+
566
+ **[→ Go to Stage 8: Practical Examples 🚀 →](stage-08-examples.md)
567
+
568
+ ---
569
+
570
+ **[← Return to Main Directory](../README.md)**
571
+
572
+ ---