@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,481 @@
1
+ # Insurance Service Example - Test Results
2
+
3
+ This document records the actual execution results of the Insurance example on the WoWok testnet.
4
+
5
+ ## Test Environment
6
+ - **Network**: testnet
7
+ - **Test Date**: 2026-05-03
8
+ - **SDK Version**: WoWok TypeScript SDK (local build)
9
+
10
+ ## Overview
11
+
12
+ This example demonstrates an outdoor accident insurance service with time-lock completion guards. The service uses a simple two-node workflow (Start -> Complete) where the completion requires a time-lock guard to prevent premature order finalization.
13
+
14
+ ## Key Object Addresses
15
+
16
+ | Object Type | Name | Object Address |
17
+ |-------------|------|----------------|
18
+ | Permission | insurance_permission_v1 | 0x93221f078e5aff1bab5f6486f9a0922268c3734a1ed5a9535109439bb7dd17e4 |
19
+ | Guard (Complete) | insurance_complete_guard_v1 | 0x3c07695d6f01c875c718bef8fae78cdf9ee19bcb174a9b35bb6213c29816f200 |
20
+ | Guard (Withdraw) | insurance_withdraw_guard_v1 | 0xc736a8296bd502aeae7802aadaf9a8d194ce2d498f5a1ed8fe63c33981f523b3 |
21
+ | Machine | insurance_machine_v1 | 0xd66d95bc0ed855ba0c0a650368f025871f817ca2145d6ea09b9566a2f17f74b3 |
22
+ | Service | insurance_service_v1 | 0x161b4a7398dd2fca54559e924c7f1619169f88e81c36bbad06ebb2931f5f2e32 |
23
+ | Test Order | test_insurance_order_v1 | 0xf0809ed1ee30e4d7cf1e8fc91c00e70e2d219f6d447aaa633b28a8d83f9ea243 |
24
+ | Progress | - | 0x5d06b916e8d6ce8fb75ad2b46426335c297d890d60a99cdbc8c59c6616ab0f8c |
25
+
26
+ ---
27
+
28
+ ## Part 1: Merchant System Setup - Actual Execution Results
29
+
30
+ ### Create Merchant Account and Get Test Tokens
31
+
32
+ **Create Account:**
33
+ ```json
34
+ {
35
+ "gen": {
36
+ "name": "insurance_provider_v1",
37
+ "replaceExistName": true
38
+ }
39
+ }
40
+ ```
41
+
42
+ **Execution Result:**
43
+ ```json
44
+ {
45
+ "gen": {
46
+ "address": "0xda54ebfdbeecec5cae8ae8cdb2d0bf741dfc4e1051c0b4c7bb9968b441067e02",
47
+ "name": "insurance_provider_v1"
48
+ }
49
+ }
50
+ ```
51
+
52
+ **Get Test Tokens:**
53
+ ```json
54
+ {
55
+ "faucet": {
56
+ "network": "testnet",
57
+ "name_or_address": "insurance_provider_v1"
58
+ }
59
+ }
60
+ ```
61
+
62
+ **Execution Result:** Successfully received 5 WOW tokens (5,000,000,000 MIST).
63
+
64
+ ---
65
+
66
+ ### Step 1: Create Permission Object
67
+
68
+ **Prompt:**
69
+ ```json
70
+ {
71
+ "operation_type": "permission",
72
+ "data": {
73
+ "object": {
74
+ "name": "insurance_permission_v1",
75
+ "tags": ["insurance", "outdoor", "accident"],
76
+ "replaceExistName": true
77
+ },
78
+ "description": "Permission for outdoor accident insurance service"
79
+ },
80
+ "env": {
81
+ "account": "insurance_provider_v1",
82
+ "network": "testnet"
83
+ }
84
+ }
85
+ ```
86
+
87
+ **Execution Result:**
88
+ - **Object Address**: 0x93221f078e5aff1bab5f6486f9a0922268c3734a1ed5a9535109439bb7dd17e4
89
+ - **Transaction**: 58gPUwgwM6npS7cs5XbpmCg7SVoTodE8PpTCMLYAMt6m
90
+ - **Status**: Success
91
+
92
+ ---
93
+
94
+ ### Step 2: Create Insurance Complete Guard (Time-Lock)
95
+
96
+ **Guard Definition** (`insurance_complete_guard_v1.json`):
97
+ ```json
98
+ {
99
+ "namedNew": {
100
+ "name": "insurance_complete_guard_v1",
101
+ "tags": ["insurance", "complete", "time-lock"],
102
+ "replaceExistName": true
103
+ },
104
+ "description": "Time-lock guard for insurance claim completion",
105
+ "table": [
106
+ {
107
+ "identifier": 0,
108
+ "b_submission": true,
109
+ "value_type": "Address",
110
+ "name": "Order ID (submitted at runtime)"
111
+ },
112
+ {
113
+ "identifier": 1,
114
+ "b_submission": false,
115
+ "value_type": "U64",
116
+ "value": "1000",
117
+ "name": "Time-lock duration in ms"
118
+ }
119
+ ],
120
+ "root": {
121
+ "type": "logic_as_u256_greater",
122
+ "nodes": [
123
+ {
124
+ "type": "context",
125
+ "context": "Clock"
126
+ },
127
+ {
128
+ "type": "calc_number_add",
129
+ "nodes": [
130
+ {
131
+ "type": "query",
132
+ "query": "progress.current_time",
133
+ "object": {
134
+ "identifier": 0,
135
+ "convert_witness": 100
136
+ },
137
+ "parameters": []
138
+ },
139
+ {
140
+ "type": "identifier",
141
+ "identifier": 1
142
+ }
143
+ ]
144
+ }
145
+ ]
146
+ }
147
+ }
148
+ ```
149
+
150
+ **Key Design Pattern**: Uses `convert_witness: 100` (WitnessType.TypeOrderProgress) to convert the submitted Order ID to access its associated Progress object's `current_time` field.
151
+
152
+ **Execution Result:**
153
+ - **Object Address**: 0x3c07695d6f01c875c718bef8fae78cdf9ee19bcb174a9b35bb6213c29816f200
154
+ - **Transaction**: Bi6ykn7kewLsAjhUGLMKeErVJ9J7yvm8UsW78Y7F9We1
155
+ - **Status**: Success
156
+
157
+ ---
158
+
159
+ ### Step 3: Create Insurance Withdraw Guard
160
+
161
+ **Guard Definition** (`insurance_withdraw_guard_v1.json`):
162
+ ```json
163
+ {
164
+ "namedNew": {
165
+ "name": "insurance_withdraw_guard_v1",
166
+ "tags": ["insurance", "withdraw"],
167
+ "replaceExistName": true
168
+ },
169
+ "description": "Allow insurance provider to withdraw funds after order is completed.",
170
+ "table": [
171
+ {
172
+ "identifier": 0,
173
+ "b_submission": true,
174
+ "value_type": "Address",
175
+ "name": "order_id"
176
+ },
177
+ {
178
+ "identifier": 1,
179
+ "b_submission": false,
180
+ "value_type": "String",
181
+ "value": "Complete",
182
+ "name": "complete_node"
183
+ }
184
+ ],
185
+ "root": {
186
+ "type": "logic_equal",
187
+ "nodes": [
188
+ {
189
+ "type": "query",
190
+ "query": "progress.current",
191
+ "object": {
192
+ "identifier": 0,
193
+ "convert_witness": 100
194
+ },
195
+ "parameters": []
196
+ },
197
+ {
198
+ "type": "identifier",
199
+ "identifier": 1
200
+ }
201
+ ]
202
+ }
203
+ }
204
+ ```
205
+
206
+ **Execution Result:**
207
+ - **Object Address**: 0xc736a8296bd502aeae7802aadaf9a8d194ce2d498f5a1ed8fe63c33981f523b3
208
+ - **Transaction**: FrL3z1jExLrs652vFr12faL9Xb5XMzh9vT9hZWPdgJyz
209
+ - **Status**: Success
210
+
211
+ ---
212
+
213
+ ### Step 4: Create Insurance Machine
214
+
215
+ **Prompt:**
216
+ ```json
217
+ {
218
+ "operation_type": "machine",
219
+ "data": {
220
+ "object": {
221
+ "name": "insurance_machine_v1",
222
+ "permission": "insurance_permission_v1",
223
+ "replaceExistName": true
224
+ },
225
+ "description": "Insurance claim processing workflow: Start -> Complete (with time-lock guard)",
226
+ "node": {
227
+ "op": "add",
228
+ "data": [
229
+ {
230
+ "name": "Start",
231
+ "pairs": [
232
+ {
233
+ "prev_node": "",
234
+ "forwards": [
235
+ {
236
+ "name": "claim",
237
+ "guard": [],
238
+ "next_node_name": "Complete"
239
+ }
240
+ ]
241
+ }
242
+ ]
243
+ },
244
+ {
245
+ "name": "Complete",
246
+ "pairs": [
247
+ {
248
+ "prev_node": "Start",
249
+ "forwards": [
250
+ {
251
+ "name": "complete_claim",
252
+ "guard": ["insurance_complete_guard_v1"],
253
+ "next_node_name": ""
254
+ }
255
+ ]
256
+ }
257
+ ]
258
+ }
259
+ ]
260
+ },
261
+ "publish": true
262
+ },
263
+ "env": {
264
+ "account": "insurance_provider_v1",
265
+ "network": "testnet"
266
+ }
267
+ }
268
+ ```
269
+
270
+ **Execution Result:**
271
+ - **Object Address**: 0xd66d95bc0ed855ba0c0a650368f025871f817ca2145d6ea09b9566a2f17f74b3
272
+ - **Transaction**: BBjtFHkZQc7ag4uHziGNmB719g9w4vMNRX4j1AB4EQMq
273
+ - **Status**: Success
274
+ - **Node Count**: 2
275
+ - **Published**: Yes
276
+
277
+ ---
278
+
279
+ ### Step 5: Create Insurance Service
280
+
281
+ **Prompt:**
282
+ ```json
283
+ {
284
+ "operation_type": "service",
285
+ "data": {
286
+ "object": {
287
+ "name": "insurance_service_v1",
288
+ "permission": "insurance_permission_v1",
289
+ "replaceExistName": true
290
+ },
291
+ "description": "Outdoor accident insurance for Iceland travel. Provides coverage for ice scooting and other outdoor activities.",
292
+ "machine": "insurance_machine_v1",
293
+ "sales": [
294
+ {
295
+ "name": "Outdoor Accident Insurance",
296
+ "price": "100000000",
297
+ "stock": "999"
298
+ }
299
+ ],
300
+ "order_allocators": {
301
+ "description": "Insurance order revenue allocation",
302
+ "threshold": "0",
303
+ "allocators": [
304
+ {
305
+ "guard": "insurance_withdraw_guard_v1",
306
+ "sharing": [
307
+ {
308
+ "who": "Signer",
309
+ "sharing": "10000",
310
+ "mode": 1
311
+ }
312
+ ],
313
+ "fix": "0",
314
+ "max": null
315
+ }
316
+ ]
317
+ },
318
+ "publish": true
319
+ },
320
+ "env": {
321
+ "account": "insurance_provider_v1",
322
+ "network": "testnet"
323
+ }
324
+ }
325
+ ```
326
+
327
+ **Execution Result:**
328
+ - **Object Address**: 0x161b4a7398dd2fca54559e924c7f1619169f88e81c36bbad06ebb2931f5f2e32
329
+ - **Transaction**: ju5K75sakrHsWnSLDv42kNTE37Q9LKF3Ue9ML9c2taT
330
+ - **Status**: Success
331
+ - **Published**: Yes
332
+ - **Paused**: No
333
+
334
+ ---
335
+
336
+ ### Step 6: Unpause Service
337
+
338
+ The service was already unpaused after creation. Verified configuration:
339
+ - **Service Status**: Active
340
+ - **Machine Bound**: insurance_machine_v1
341
+ - **Sales**: 1 item available
342
+ - **Order Allocators**: 1 allocator configured
343
+
344
+ ---
345
+
346
+ ## Part 2: Order Workflow Test
347
+
348
+ ### Test Order Creation
349
+
350
+ **Prompt:**
351
+ ```json
352
+ {
353
+ "operation_type": "order",
354
+ "data": {
355
+ "object": {
356
+ "name": "test_insurance_order_v1",
357
+ "replaceExistName": true
358
+ },
359
+ "service": "insurance_service_v1",
360
+ "item": {
361
+ "name": "Outdoor Accident Insurance",
362
+ "price": "100000000",
363
+ "quantity": 1
364
+ }
365
+ },
366
+ "env": {
367
+ "account": "insurance_provider_v1",
368
+ "network": "testnet"
369
+ }
370
+ }
371
+ ```
372
+
373
+ **Execution Result:**
374
+ - **Order Address**: 0xf0809ed1ee30e4d7cf1e8fc91c00e70e2d219f6d447aaa633b28a8d83f9ea243
375
+ - **Progress Address**: 0x5d06b916e8d6ce8fb75ad2b46426335c297d890d60a99cdbc8c59c6616ab0f8c
376
+ - **Transaction**: ju5K75sakrHsWnSLDv42kNTE37Q9LKF3Ue9ML9c2taT
377
+ - **Amount**: 100,000,000 MIST (0.1 WOW)
378
+
379
+ ---
380
+
381
+ ### Progress Workflow Test
382
+
383
+ #### Initial -> Start
384
+ **Prompt:**
385
+ ```json
386
+ {
387
+ "operation_type": "progress",
388
+ "data": {
389
+ "object": "test_insurance_order_v1",
390
+ "operate": {
391
+ "operation": {
392
+ "next_node_name": "Start",
393
+ "forward": "claim"
394
+ }
395
+ }
396
+ },
397
+ "env": {
398
+ "account": "insurance_provider_v1",
399
+ "network": "testnet"
400
+ }
401
+ }
402
+ ```
403
+
404
+ **Result**: Success - Progress moved from "" to "Start"
405
+
406
+ #### Start -> Complete (Time-Lock Test)
407
+
408
+ **Attempt 1 (Immediate - Should Fail):**
409
+ ```json
410
+ {
411
+ "operation_type": "progress",
412
+ "data": {
413
+ "object": "test_insurance_order_v1",
414
+ "operate": {
415
+ "operation": {
416
+ "next_node_name": "Complete",
417
+ "forward": "complete_claim"
418
+ }
419
+ }
420
+ },
421
+ "submission": {
422
+ "type": "submission",
423
+ "guard": [{"object": "insurance_complete_guard_v1", "impack": true}],
424
+ "submission": [{
425
+ "guard": "insurance_complete_guard_v1",
426
+ "submission": [{
427
+ "identifier": 0,
428
+ "b_submission": true,
429
+ "value_type": "Address",
430
+ "value": "0xf0809ed1ee30e4d7cf1e8fc91c00e70e2d219f6d447aaa633b28a8d83f9ea243"
431
+ }]
432
+ }]
433
+ },
434
+ "env": {
435
+ "account": "insurance_provider_v1",
436
+ "network": "testnet"
437
+ }
438
+ }
439
+ ```
440
+
441
+ **Result**: Guard validation failed - Time-lock not yet expired (expected behavior)
442
+
443
+ **Attempt 2 (After 1.5s - Should Succeed):**
444
+
445
+ Waited 1.5 seconds and retried the same operation.
446
+
447
+ **Result**: Success - Progress moved from "Start" to "Complete"
448
+ - **Transaction**: mqLXfDYKwGwJPg3jytvzC9NnPeykSkioV6nKqKgvmFt
449
+ - **Current Node**: Complete
450
+ - **History Count**: 2
451
+
452
+ ---
453
+
454
+ ## Summary
455
+
456
+ ### Test Results
457
+
458
+ | Test Case | Expected | Actual | Status |
459
+ |-----------|----------|--------|--------|
460
+ | Account Creation | Success | Success | ✅ |
461
+ | Permission Creation | Success | Success | ✅ |
462
+ | Guard Creation (Complete) | Success | Success | ✅ |
463
+ | Guard Creation (Withdraw) | Success | Success | ✅ |
464
+ | Machine Creation | Success | Success | ✅ |
465
+ | Service Creation | Success | Success | ✅ |
466
+ | Order Creation | Success | Success | ✅ |
467
+ | Progress: Initial -> Start | Success | Success | ✅ |
468
+ | Progress: Start -> Complete (Immediate) | Fail (Time-Lock) | Failed as expected | ✅ |
469
+ | Progress: Start -> Complete (After 1.5s) | Success | Success | ✅ |
470
+
471
+ ### Key Learnings
472
+
473
+ 1. **Time-Lock Implementation**: The `convert_witness: 100` (TypeOrderProgress) is essential for accessing Progress data from an Order ID submission.
474
+
475
+ 2. **Guard Submission Schema**: Guard submissions require `b_submission` and `value_type` fields to be explicitly specified.
476
+
477
+ 3. **Machine Node Structure**: The `prev_node: ""` (empty string) defines the entry point from the initial Progress state.
478
+
479
+ 4. **Submission Parameter Location**: Guard submissions must be passed as a top-level `submission` parameter, not nested within `data.operate`.
480
+
481
+ ---
@@ -0,0 +1,50 @@
1
+ {
2
+ "namedNew": {
3
+ "name": "insurance_complete_guard_v1",
4
+ "tags": ["insurance", "time-lock", "complete"],
5
+ "replaceExistName": true
6
+ },
7
+ "description": "Time-lock guard for insurance claim completion. Requires clock > progress.current_time + 1000ms.",
8
+ "table": [
9
+ {
10
+ "identifier": 0,
11
+ "b_submission": true,
12
+ "value_type": "Address",
13
+ "name": "Order ID (submitted at runtime)"
14
+ },
15
+ {
16
+ "identifier": 1,
17
+ "b_submission": false,
18
+ "value_type": "U64",
19
+ "value": 1000,
20
+ "name": "Time-lock duration in ms"
21
+ }
22
+ ],
23
+ "root": {
24
+ "type": "logic_as_u256_greater",
25
+ "nodes": [
26
+ {
27
+ "type": "context",
28
+ "context": "Clock"
29
+ },
30
+ {
31
+ "type": "calc_number_add",
32
+ "nodes": [
33
+ {
34
+ "type": "query",
35
+ "query": 1272,
36
+ "object": {
37
+ "identifier": 0,
38
+ "convert_witness": 100
39
+ },
40
+ "parameters": []
41
+ },
42
+ {
43
+ "type": "identifier",
44
+ "identifier": 1
45
+ }
46
+ ]
47
+ }
48
+ ]
49
+ }
50
+ }