@wowok/skills 1.1.9 → 1.1.11

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 (40) hide show
  1. package/LICENSE +36 -0
  2. package/README.md +1 -8
  3. package/dist/cli.js +4 -0
  4. package/dist/cli.js.map +1 -1
  5. package/dist/skills.d.ts.map +1 -1
  6. package/dist/skills.js +33 -0
  7. package/dist/skills.js.map +1 -1
  8. package/examples/Insurance/Insurance.md +218 -90
  9. package/examples/MyShop/MyShop.md +513 -245
  10. package/examples/MyShop/myshop_machine_nodes.json +87 -0
  11. package/examples/MyShop_Advanced/MyShop_Advanced.md +633 -228
  12. package/examples/ThreeBody_Signature/ThreeBody_Signature.md +195 -202
  13. package/examples/Travel/Travel.md +775 -487
  14. package/examples/Travel/calc-weather-timestamps.js +9 -5
  15. package/package.json +8 -3
  16. package/scripts/install.js +4 -0
  17. package/wowok-arbitrator/SKILL.md +542 -1
  18. package/wowok-auditor/SKILL.md +581 -0
  19. package/wowok-guard/SKILL.md +425 -1
  20. package/wowok-machine/SKILL.md +404 -1
  21. package/wowok-messenger/SKILL.md +551 -1
  22. package/wowok-onboard/SKILL.md +520 -0
  23. package/wowok-order/SKILL.md +528 -1
  24. package/wowok-output/SKILL.md +571 -0
  25. package/wowok-planner/SKILL.md +757 -0
  26. package/wowok-provider/SKILL.md +455 -1
  27. package/wowok-safety/SKILL.md +557 -0
  28. package/wowok-scenario/SKILL.md +585 -0
  29. package/wowok-tools/SKILL.md +423 -1
  30. package/examples/Insurance/Insurance_TestResults.md +0 -481
  31. package/examples/Insurance/insurance_complete_guard_v1.json +0 -50
  32. package/examples/MyShop/MyShop_TestResults.md +0 -1003
  33. package/examples/MyShop_Advanced/MyShop_Advanced_MerchantSystem_TestResults.md +0 -1297
  34. package/examples/MyShop_Advanced/MyShop_Advanced_OrderFlow_TestResults.md +0 -743
  35. package/examples/MyShop_Advanced/machine_nodes.json +0 -222
  36. package/examples/MyShop_Advanced/three_body_signature.wip +0 -30
  37. package/examples/ThreeBody_Signature/ThreeBody_Signature_TestResults.md +0 -599
  38. package/examples/Travel/Travel_TestResults.md +0 -743
  39. package/examples/Travel/travel_machine_v2_export.json +0 -104
  40. package/examples/Travel/weather_check_guard_v1.json +0 -51
@@ -8,7 +8,7 @@ A complete example demonstrating how to create a service for book signing by the
8
8
 
9
9
  This example demonstrates:
10
10
 
11
- **Service with Buy Guard**: The buy_guard allows you to define various conditions for users to purchase products, such as identity verification, completing KYC, or being on an allowlist. In this example, only the service creator (author) can purchase this service
11
+ **Service with Buy Guard**: The buy_guard allows you to define various conditions for users to purchase products, such as identity verification, completing KYC, or being on an allowlist. In this example, only the service creator (author) can purchase this service.
12
12
 
13
13
  ### Key Design Decisions
14
14
 
@@ -33,17 +33,45 @@ Before running this example, ensure you have:
33
33
  {
34
34
  "query_type": "account_balance",
35
35
  "name_or_address": "three_body_author",
36
+ "balance": true,
36
37
  "network": "testnet"
37
38
  }
38
39
  ```
39
40
 
40
- **Actual Result**:
41
+ **Expected Result** (if account has balance):
41
42
  ```json
42
43
  {
43
- "address": "0xda123833e96e734815f2f57d52ad463681635c6678cfe113c77dbeee49d7865c",
44
+ "address": "0x...",
44
45
  "balance": {
45
46
  "coinType": "0x2::wow::WOW",
46
- "totalBalance": "4904827524"
47
+ "totalBalance": "1000000000"
48
+ }
49
+ }
50
+ ```
51
+
52
+ **If no balance, use Faucet**:
53
+
54
+ **Request**:
55
+ ```json
56
+ {
57
+ "faucet": {
58
+ "network": "testnet",
59
+ "name_or_address": "three_body_author"
60
+ }
61
+ }
62
+ ```
63
+
64
+ **Expected Result**:
65
+ ```json
66
+ {
67
+ "faucet": {
68
+ "name_or_address": "three_body_author",
69
+ "result": [
70
+ {"amount": 1000000000, "id": "0x..."},
71
+ {"amount": 1000000000, "id": "0x..."},
72
+ {"amount": 1000000000, "id": "0x..."}
73
+ ],
74
+ "network": "testnet"
47
75
  }
48
76
  }
49
77
  ```
@@ -60,10 +88,10 @@ Create a Permission object to manage the service.
60
88
  "operation_type": "permission",
61
89
  "data": {
62
90
  "object": {
63
- "name": "three_body_permission_v2",
91
+ "name": "three_body_permission",
64
92
  "replaceExistName": true
65
93
  },
66
- "description": "Permission for Three-Body Signature Service v2",
94
+ "description": "Permission for Three-Body Signature Service",
67
95
  "table": {
68
96
  "op": "add perm by entity",
69
97
  "entity": {"name_or_address": "three_body_author"},
@@ -77,12 +105,12 @@ Create a Permission object to manage the service.
77
105
  }
78
106
  ```
79
107
 
80
- **Actual Result**:
108
+ **Expected Result**:
81
109
  ```json
82
110
  [{
83
111
  "type": "Permission",
84
- "object": "0xf939b4be49761ef8c30ff19ee874157e2ba1d83ab3a8de4f310443e588d1df99",
85
- "version": "2195623",
112
+ "object": "0x...",
113
+ "version": "...",
86
114
  "change": "created"
87
115
  }]
88
116
  ```
@@ -99,7 +127,7 @@ Create a Guard that verifies the buyer is the service creator (author). This ens
99
127
  "operation_type": "guard",
100
128
  "data": {
101
129
  "namedNew": {
102
- "name": "three_body_buy_guard_v2",
130
+ "name": "three_body_buy_guard",
103
131
  "tags": ["signature", "book", "buy-guard"],
104
132
  "replaceExistName": true
105
133
  },
@@ -109,25 +137,22 @@ Create a Guard that verifies the buyer is the service creator (author). This ens
109
137
  "identifier": 0,
110
138
  "b_submission": false,
111
139
  "value_type": "Address",
112
- "value": "0xda123833e96e734815f2f57d52ad463681635c6678cfe113c77dbeee49d7865c",
113
- "name": "author_address"
140
+ "value": "three_body_author",
141
+ "name": "Author address"
114
142
  }
115
143
  ],
116
144
  "root": {
117
- "type": "node",
118
- "node": {
119
- "type": "logic_equal",
120
- "nodes": [
121
- {
122
- "type": "context",
123
- "context": "Signer"
124
- },
125
- {
126
- "type": "identifier",
127
- "identifier": 0
128
- }
129
- ]
130
- }
145
+ "type": "logic_equal",
146
+ "nodes": [
147
+ {
148
+ "type": "context",
149
+ "context": "Signer"
150
+ },
151
+ {
152
+ "type": "identifier",
153
+ "identifier": 0
154
+ }
155
+ ]
131
156
  }
132
157
  },
133
158
  "env": {
@@ -137,12 +162,14 @@ Create a Guard that verifies the buyer is the service creator (author). This ens
137
162
  }
138
163
  ```
139
164
 
140
- **Actual Result**:
165
+ > **Note**: The Guard uses a `table` to define constant values with identifiers, then references them in the `root` logic using `identifier` node type. The `root` is a direct GuardNode (no wrapper).
166
+
167
+ **Expected Result**:
141
168
  ```json
142
169
  [{
143
170
  "type": "Guard",
144
- "object": "0x2fc0283e55f4322eb602a5370b32e455597e339c74a23ada5d9a4a82f02f7925",
145
- "version": "2195993",
171
+ "object": "0x...",
172
+ "version": "...",
146
173
  "change": "created"
147
174
  }]
148
175
  ```
@@ -161,11 +188,11 @@ Create a Machine to define the service workflow: Book Delivery → Signature Com
161
188
  "operation_type": "machine",
162
189
  "data": {
163
190
  "object": {
164
- "name": "three_body_machine_v2",
165
- "permission": "three_body_permission_v2",
191
+ "name": "three_body_machine",
192
+ "permission": "three_body_permission",
166
193
  "replaceExistName": true
167
194
  },
168
- "description": "Three-Body signature service workflow v2: Book Delivery -> Signature Completion",
195
+ "description": "Three-Body signature service workflow: Book Delivery -> Signature Completion",
169
196
  "node": {
170
197
  "op": "add",
171
198
  "nodes": [
@@ -212,18 +239,16 @@ Create a Machine to define the service workflow: Book Delivery → Signature Com
212
239
  }
213
240
  ```
214
241
 
215
- **Actual Result**:
242
+ **Expected Result**:
216
243
  ```json
217
244
  [{
218
245
  "type": "Machine",
219
- "object": "0x8e7e1c3f173c9e2203ca2e1e50b4c634dd1cef06d248ac50e35749adf7499411",
220
- "version": "2196424",
246
+ "object": "0x...",
247
+ "version": "...",
221
248
  "change": "created"
222
249
  }]
223
250
  ```
224
251
 
225
-
226
-
227
252
  ---
228
253
 
229
254
  ## Step 4: Create Service (Unpublished)
@@ -236,12 +261,12 @@ Create the Three-Body signature service without publishing. The Service must be
236
261
  "operation_type": "service",
237
262
  "data": {
238
263
  "object": {
239
- "name": "three_body_signature_service_v2",
264
+ "name": "three_body_signature_service",
240
265
  "type_parameter": "0x2::wow::WOW",
241
- "permission": "three_body_permission_v2",
266
+ "permission": "three_body_permission",
242
267
  "replaceExistName": true
243
268
  },
244
- "description": "Three-Body author book signature service v2. Provide a message up to 10 characters, and the author will sign your book. Process: 1.Book Delivery 2.Signature Completion. Fee: 888.",
269
+ "description": "Three-Body author book signature service. Provide a message up to 10 characters, and the author will sign your book. Process: 1.Book Delivery 2.Signature Completion. Fee: 888.",
245
270
  "publish": false
246
271
  },
247
272
  "env": {
@@ -251,12 +276,12 @@ Create the Three-Body signature service without publishing. The Service must be
251
276
  }
252
277
  ```
253
278
 
254
- **Actual Result**:
279
+ **Expected Result**:
255
280
  ```json
256
281
  [{
257
282
  "type": "Service",
258
- "object": "0x140e91943775592736f587e596afce7d28f41fee1593f8dfbc2f04d852e5d45c",
259
- "version": "2198123",
283
+ "object": "0x...",
284
+ "version": "...",
260
285
  "change": "created"
261
286
  }]
262
287
  ```
@@ -272,8 +297,8 @@ Bind the published Machine to the Service. **Important**: The Service must be un
272
297
  {
273
298
  "operation_type": "service",
274
299
  "data": {
275
- "object": "three_body_signature_service_v2",
276
- "machine": "three_body_machine_v2"
300
+ "object": "three_body_signature_service",
301
+ "machine": "three_body_machine"
277
302
  },
278
303
  "env": {
279
304
  "account": "three_body_author",
@@ -282,24 +307,16 @@ Bind the published Machine to the Service. **Important**: The Service must be un
282
307
  }
283
308
  ```
284
309
 
285
- **Actual Result**:
310
+ **Expected Result**:
286
311
  ```json
287
312
  [{
288
313
  "type": "Service",
289
- "object": "0x140e91943775592736f587e596afce7d28f41fee1593f8dfbc2f04d852e5d45c",
290
- "version": "2198329",
314
+ "object": "0x...",
315
+ "version": "...",
291
316
  "change": "mutated"
292
317
  }]
293
318
  ```
294
319
 
295
- **Verification** (with no_cache: true):
296
- ```json
297
- {
298
- "machine": "0x8e7e1c3f173c9e2203ca2e1e50b4c634dd1cef06d248ac50e35749adf7499411",
299
- "bPublished": false
300
- }
301
- ```
302
-
303
320
  ---
304
321
 
305
322
  ## Step 6: Set Buy Guard
@@ -311,8 +328,8 @@ Configure the Buy Guard to restrict purchases to the author only.
311
328
  {
312
329
  "operation_type": "service",
313
330
  "data": {
314
- "object": "three_body_signature_service_v2",
315
- "buy_guard": "three_body_buy_guard_v2"
331
+ "object": "three_body_signature_service",
332
+ "buy_guard": "three_body_buy_guard"
316
333
  },
317
334
  "env": {
318
335
  "account": "three_body_author",
@@ -321,12 +338,12 @@ Configure the Buy Guard to restrict purchases to the author only.
321
338
  }
322
339
  ```
323
340
 
324
- **Actual Result**:
341
+ **Expected Result**:
325
342
  ```json
326
343
  [{
327
344
  "type": "Service",
328
- "object": "0x140e91943775592736f587e596afce7d28f41fee1593f8dfbc2f04d852e5d45c",
329
- "version": "2203786",
345
+ "object": "0x...",
346
+ "version": "...",
330
347
  "change": "mutated"
331
348
  }]
332
349
  ```
@@ -342,13 +359,13 @@ Set up fund allocation: 100% to the author upon order completion.
342
359
  {
343
360
  "operation_type": "service",
344
361
  "data": {
345
- "object": "three_body_signature_service_v2",
362
+ "object": "three_body_signature_service",
346
363
  "order_allocators": {
347
364
  "description": "Three-Body signature service fund allocation - 100% to author",
348
365
  "threshold": 0,
349
366
  "allocators": [
350
367
  {
351
- "guard": "three_body_buy_guard_v2",
368
+ "guard": "three_body_buy_guard",
352
369
  "sharing": [
353
370
  {
354
371
  "who": {
@@ -370,12 +387,12 @@ Set up fund allocation: 100% to the author upon order completion.
370
387
  }
371
388
  ```
372
389
 
373
- **Actual Result**:
390
+ **Expected Result**:
374
391
  ```json
375
392
  [{
376
393
  "type": "Service",
377
- "object": "0x140e91943775592736f587e596afce7d28f41fee1593f8dfbc2f04d852e5d45c",
378
- "version": "2203787",
394
+ "object": "0x...",
395
+ "version": "...",
379
396
  "change": "mutated"
380
397
  }]
381
398
  ```
@@ -391,7 +408,7 @@ Add sales items and publish the service to make it available for orders.
391
408
  {
392
409
  "operation_type": "service",
393
410
  "data": {
394
- "object": "three_body_signature_service_v2",
411
+ "object": "three_body_signature_service",
395
412
  "sales": {
396
413
  "op": "add",
397
414
  "sales": [
@@ -414,12 +431,12 @@ Add sales items and publish the service to make it available for orders.
414
431
  }
415
432
  ```
416
433
 
417
- **Actual Result**:
434
+ **Expected Result**:
418
435
  ```json
419
436
  [{
420
437
  "type": "Service",
421
- "object": "0x140e91943775592736f587e596afce7d28f41fee1593f8dfbc2f04d852e5d45c",
422
- "version": "2205976",
438
+ "object": "0x...",
439
+ "version": "...",
423
440
  "change": "mutated"
424
441
  }]
425
442
  ```
@@ -435,7 +452,7 @@ Unpause the service to allow order creation.
435
452
  {
436
453
  "operation_type": "service",
437
454
  "data": {
438
- "object": "three_body_signature_service_v2",
455
+ "object": "three_body_signature_service",
439
456
  "pause": false
440
457
  },
441
458
  "env": {
@@ -445,12 +462,12 @@ Unpause the service to allow order creation.
445
462
  }
446
463
  ```
447
464
 
448
- **Actual Result**:
465
+ **Expected Result**:
449
466
  ```json
450
467
  [{
451
468
  "type": "Service",
452
- "object": "0x140e91943775592736f587e596afce7d28f41fee1593f8dfbc2f04d852e5d45c",
453
- "version": "2205975",
469
+ "object": "0x...",
470
+ "version": "...",
454
471
  "change": "mutated"
455
472
  }]
456
473
  ```
@@ -465,18 +482,18 @@ Query the service to verify all configurations.
465
482
  ```json
466
483
  {
467
484
  "query_type": "onchain_objects",
468
- "objects": ["three_body_signature_service_v2"],
485
+ "objects": ["three_body_signature_service"],
469
486
  "no_cache": true,
470
487
  "network": "testnet"
471
488
  }
472
489
  ```
473
490
 
474
- **Actual Result**:
491
+ **Expected Result**:
475
492
  ```json
476
493
  {
477
- "object": "0x140e91943775592736f587e596afce7d28f41fee1593f8dfbc2f04d852e5d45c",
494
+ "object": "three_body_signature_service",
478
495
  "type": "Service",
479
- "description": "Three-Body author book signature service v2. Provide a message up to 10 characters, and the author will sign your book. Process: 1.Book Delivery 2.Signature Completion. Fee: 888.",
496
+ "description": "Three-Body author book signature service. Provide a message up to 10 characters, and the author will sign your book. Process: 1.Book Delivery 2.Signature Completion. Fee: 888.",
480
497
  "sales": [
481
498
  {
482
499
  "name": "Three-Body Book Signature",
@@ -487,12 +504,12 @@ Query the service to verify all configurations.
487
504
  "wip_hash": ""
488
505
  }
489
506
  ],
490
- "buy_guard": "0x2fc0283e55f4322eb602a5370b32e455597e339c74a23ada5d9a4a82f02f7925",
491
- "machine": "0x8e7e1c3f173c9e2203ca2e1e50b4c634dd1cef06d248ac50e35749adf7499411",
507
+ "buy_guard": "three_body_buy_guard",
508
+ "machine": "three_body_machine",
492
509
  "bPublished": true,
493
510
  "bPaused": false,
494
511
  "customer_required": ["phone", "email", "shipping_address"],
495
- "permission": "0xf939b4be49761ef8c30ff19ee874157e2ba1d83ab3a8de4f310443e588d1df99"
512
+ "permission": "three_body_permission"
496
513
  }
497
514
  ```
498
515
 
@@ -509,7 +526,7 @@ The author (`three_body_author`) should be able to purchase the service.
509
526
  {
510
527
  "operation_type": "service",
511
528
  "data": {
512
- "object": "three_body_signature_service_v2",
529
+ "object": "three_body_signature_service",
513
530
  "order_new": {
514
531
  "buy": {
515
532
  "items": [
@@ -524,11 +541,15 @@ The author (`three_body_author`) should be able to purchase the service.
524
541
  }
525
542
  },
526
543
  "namedNewOrder": {
527
- "name": "three_body_order_v2",
544
+ "name": "three_body_order",
528
545
  "replaceExistName": true
529
546
  },
530
547
  "namedNewProgress": {
531
- "name": "three_body_progress_v2",
548
+ "name": "three_body_progress",
549
+ "replaceExistName": true
550
+ },
551
+ "namedNewAllocation": {
552
+ "name": "three_body_allocation",
532
553
  "replaceExistName": true
533
554
  }
534
555
  }
@@ -540,6 +561,30 @@ The author (`three_body_author`) should be able to purchase the service.
540
561
  }
541
562
  ```
542
563
 
564
+ **Expected Result**:
565
+ ```json
566
+ [
567
+ {
568
+ "type": "Progress",
569
+ "object": "three_body_progress",
570
+ "version": "...",
571
+ "change": "created"
572
+ },
573
+ {
574
+ "type": "Order",
575
+ "object": "three_body_order",
576
+ "version": "...",
577
+ "change": "created"
578
+ },
579
+ {
580
+ "type": "Allocation",
581
+ "object": "three_body_allocation",
582
+ "version": "...",
583
+ "change": "created"
584
+ }
585
+ ]
586
+ ```
587
+
543
588
  ---
544
589
 
545
590
  ### Test 2: Non-Author Purchase (Should Fail)
@@ -551,7 +596,7 @@ Any other account attempting to purchase should fail with Buy Guard verification
551
596
  {
552
597
  "operation_type": "service",
553
598
  "data": {
554
- "object": "three_body_signature_service_v2",
599
+ "object": "three_body_signature_service",
555
600
  "order_new": {
556
601
  "buy": {
557
602
  "items": [
@@ -568,12 +613,19 @@ Any other account attempting to purchase should fail with Buy Guard verification
568
613
  }
569
614
  },
570
615
  "env": {
571
- "account": "myshop_customer",
616
+ "account": "three_body_customer",
572
617
  "network": "testnet"
573
618
  }
574
619
  }
575
620
  ```
576
621
 
622
+ **Expected Result** (Error):
623
+ ```json
624
+ {
625
+ "error": "Transaction resolution failed: MoveAbort in 8th command, abort code: 7 (Verify failed), in '0x2::passport::result_for_guard'"
626
+ }
627
+ ```
628
+
577
629
  ---
578
630
 
579
631
  ## Workflow Execution
@@ -589,10 +641,12 @@ The author confirms the book has been delivered.
589
641
  {
590
642
  "operation_type": "progress",
591
643
  "data": {
592
- "object": "three_body_progress_v2",
593
- "forward": {
594
- "forward": "Confirm Delivery",
595
- "namedOperator": ""
644
+ "object": "three_body_progress",
645
+ "operate": {
646
+ "operation": {
647
+ "next_node_name": "Book Delivered",
648
+ "forward": "Confirm Delivery"
649
+ }
596
650
  }
597
651
  },
598
652
  "env": {
@@ -602,28 +656,53 @@ The author confirms the book has been delivered.
602
656
  }
603
657
  ```
604
658
 
659
+ **Expected Result**:
660
+ ```json
661
+ [{
662
+ "type": "Progress",
663
+ "object": "three_body_progress",
664
+ "version": "...",
665
+ "change": "mutated"
666
+ }]
667
+ ```
668
+
605
669
  ### Node 2: Signature Completed
606
670
 
607
671
  The author completes the signature.
608
672
 
673
+ > **Important**: Use `no_cache: true` in the `env` for sequential Progress operations on the same object. This ensures the SDK reads the latest on-chain state (including the updated `current` node) instead of using a cached version.
674
+
609
675
  **Request**:
610
676
  ```json
611
677
  {
612
678
  "operation_type": "progress",
613
679
  "data": {
614
- "object": "three_body_progress_v2",
615
- "forward": {
616
- "forward": "Complete Signature",
617
- "namedOperator": ""
680
+ "object": "three_body_progress",
681
+ "operate": {
682
+ "operation": {
683
+ "next_node_name": "Signature Completed",
684
+ "forward": "Complete Signature"
685
+ }
618
686
  }
619
687
  },
620
688
  "env": {
621
689
  "account": "three_body_author",
622
- "network": "testnet"
690
+ "network": "testnet",
691
+ "no_cache": true
623
692
  }
624
693
  }
625
694
  ```
626
695
 
696
+ **Expected Result**:
697
+ ```json
698
+ [{
699
+ "type": "Progress",
700
+ "object": "three_body_progress",
701
+ "version": "...",
702
+ "change": "mutated"
703
+ }]
704
+ ```
705
+
627
706
  ---
628
707
 
629
708
  ## Summary
@@ -635,17 +714,17 @@ This example demonstrates:
635
714
  3. **WIP Files Optional**: Sales items can use WIP files or empty strings
636
715
  4. **Service Configuration**: Complete setup from creation to publication
637
716
 
638
- ### Key Object IDs (Actual)
717
+ ### Key Objects
639
718
 
640
- | Object | Name | ID | Version |
641
- |--------|------|-----|---------|
642
- | Permission | three_body_permission_v2 | `0xf939b4...1df99` | 2195623 |
643
- | Buy Guard | three_body_buy_guard_v2 | `0x2fc028...f7925` | 2195993 |
644
- | Machine | three_body_machine_v2 | `0x8e7e1c...99411` | 2196424 |
645
- | Service | three_body_signature_service_v2 | `0x140e91...e5d45c` | 2205976 |
646
- | Order | three_body_order_v2 | `0x7684ab...3f35d49` | 2209290 |
647
- | Allocation | three_body_allocation_v2 | `0xd6f2da...99e00` | 2209290 |
648
- | Progress | three_body_progress_v2 | `0x97ef34...d935d9` | 2209290 |
719
+ | Object | Name |
720
+ |--------|------|
721
+ | Permission | three_body_permission |
722
+ | Buy Guard | three_body_buy_guard |
723
+ | Machine | three_body_machine |
724
+ | Service | three_body_signature_service |
725
+ | Order | three_body_order |
726
+ | Allocation | three_body_allocation |
727
+ | Progress | three_body_progress |
649
728
 
650
729
  ---
651
730
 
@@ -673,104 +752,18 @@ The two-node workflow provides clear tracking:
673
752
 
674
753
  Each node transition requires the author's confirmation, ensuring accountability.
675
754
 
676
- ---
677
-
678
- ## Execution Experience & Best Practices
679
-
680
- ### 1. Naming Strategy (Critical!)
681
-
682
- **Always establish naming conventions first** :
683
-
684
- - **Example**: Use consistent suffixes or no suffixes at all
685
- - Good: `three_body_permission_v2`, `three_body_buy_guard_v2`, `three_body_machine_v2`
686
- - Good: All names follow the same pattern
687
- - Provide naming rules for AI to manage object names automatically; avoid conflicts with other naming conventions such as version/timestamp/random numbers for unique names
688
- - Strongly recommend using the `replaceExistName` method in `LocalMarkOperationSchema` to enforce name usage (even if already exists)
689
- - All operations use names instead of addresses (much easier!)
690
- - Local marks map names to addresses automatically
691
- - Easier to read, test, and document
692
-
693
- **Recommendation**:
694
- 1. Decide on naming before starting
695
- 2. Stick to it throughout the entire workflow
696
- 3. Document your naming pattern in the test results
697
-
698
- ### 2. Execution Order Matters (Critical!)
699
-
700
- **Publish operations lock objects** - plan carefully:
701
-
702
- #### Correct Order (Must Follow!)
703
- 1. **Permission** first - foundation for all other objects
704
- 2. **Machine** - create workflow before service
705
- 3. **Service (unpublished)** - get address for Guards
706
- 4. **Guards** - need Service address for verification logic
707
- 5. **Configure Service** - add machine, buy_guard, order_allocators
708
- 6. **Publish Service** - LAST! Once published, many changes are blocked
709
-
710
- ### 3. Guard Creation Tips
711
-
712
- **Guards often depend on other objects**:
713
- - Buy Guards: May reference Service address
714
- - Progress Guards: May need Machine or Service information
715
- - Order Allocator Guards: Should be created before Service publish
716
-
717
- **Best Practice**:
718
- 1. Create empty Service with name first (unpublished)
719
- 2. Create all required Guards using that name
720
- 3. Configure Service with Guards
721
- 4. Publish Service
722
-
723
- ### 4. Machine Workflow Setup
724
-
725
- **Machine nodes require permission indexes**:
726
- - If you use permissionIndex, make sure they exist!
727
- - Create permission indexes before adding machine nodes
728
-
729
- **Machine Publish**:
730
- - Must publish Machine before binding to Service
731
- - Published Machine can still have nodes added/modified
732
-
733
- ### 5. Service Configuration Flow
734
-
735
- **Configure everything before publishing**:
736
- ```
737
- Service Created (unpublished)
738
-
739
- Add Sales Items
740
-
741
- Bind Machine
742
-
743
- Set Buy Guard
744
-
745
- Configure Order Allocators
746
-
747
- Set Arbitration (if needed)
748
-
749
- PUBLISH (LAST STEP!)
750
- ```
751
-
752
- ### 6. Testing Strategy
753
-
754
- **Test incrementally, not all at once**:
755
- 1. Test each step as you go
756
- 2. Verify object creation with queries
757
- 3. Don't proceed to next step until current one is verified
758
- 4. Keep track of all object IDs in a test results file
759
-
760
- ### 7. Common Pitfalls to Avoid
761
-
762
- 1. **Price Units**: WOW tokens use 9 decimals, but testnet examples often use simple numbers (888 tokens)
763
- 2. **Local Marks**: Verify objects exist with `local_mark_list` queries
764
- 3. **Account Balance**: Always check balance before starting - gas fees add up!
755
+ ### Best Practices
765
756
 
766
- ### 8. Let AI Manage Object Naming for You
757
+ 1. **Naming Strategy**: Use consistent naming conventions and `replaceExistName: true` to enforce name usage. All operations use names instead of addresses for readability.
767
758
 
768
- ### 9. Query Toolkit is Your Best Friend
759
+ 2. **Execution Order Matters**: Publish operations lock objects. Follow this order:
760
+ - Permission first (foundation)
761
+ - Machine (create workflow before service)
762
+ - Service (unpublished)
763
+ - Guards (need Service address for verification logic)
764
+ - Configure Service (add machine, buy_guard, order_allocators)
765
+ - Publish Service (LAST - once published, many changes are blocked)
769
766
 
770
- **Use queries constantly**:
771
- - Verify objects exist
772
- - Check configurations
773
- - Debug issues
774
- - Confirm state changes
767
+ 3. **Use `no_cache: true` for Sequential Operations**: When performing multiple operations on the same object in sequence (especially Progress workflow advancement), always set `no_cache: true` in the `env` to ensure the SDK reads the latest on-chain state.
775
768
 
776
- The `query_toolkit` and `onchain_table_data` are essential for validating every step of the way.
769
+ 4. **Query Toolkit is Your Best Friend**: Use queries constantly to verify objects exist, check configurations, debug issues, and confirm state changes.