@wowok/skills 1.3.4 → 2.0.1
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 +18 -11
- package/dist/cli.js +26 -7
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/skills.d.ts +52 -5
- package/dist/skills.d.ts.map +1 -1
- package/dist/skills.js +104 -63
- package/dist/skills.js.map +1 -1
- package/examples/Insurance/Insurance.md +224 -197
- package/examples/MyShop/MyShop.md +133 -35
- package/examples/MyShop_Advanced/MyShop_Advanced.md +368 -300
- package/examples/ThreeBody_Signature/ThreeBody_Signature.md +272 -25
- package/examples/Travel/Travel.md +104 -17
- package/package.json +2 -6
- package/scripts/install.js +52 -6
- package/wowok-arbitrator/SKILL.md +1 -1
- package/wowok-auditor/SKILL.md +1 -1
- package/wowok-machine/SKILL.md +2 -2
- package/wowok-messenger/SKILL.md +5 -3
- package/wowok-onboard/SKILL.md +43 -24
- package/wowok-order/SKILL.md +22 -7
- package/wowok-output/SKILL.md +4 -4
- package/wowok-planner/SKILL.md +2 -1
- package/wowok-provider/SKILL.md +48 -38
- package/wowok-guard/SKILL.md +0 -359
- package/wowok-safety/SKILL.md +0 -275
- package/wowok-scenario/SKILL.md +0 -371
- package/wowok-tools/SKILL.md +0 -389
|
@@ -127,8 +127,7 @@ Before starting, ensure you have:
|
|
|
127
127
|
"transfer": {
|
|
128
128
|
"name_or_address_to": "myshop_merchant",
|
|
129
129
|
"amount": 1000000000,
|
|
130
|
-
"network": "mainnet"
|
|
131
|
-
"confirmed": true
|
|
130
|
+
"network": "mainnet"
|
|
132
131
|
}
|
|
133
132
|
}
|
|
134
133
|
}
|
|
@@ -417,7 +416,7 @@ Create a Contact object to enable encrypted communication between customers and
|
|
|
417
416
|
|
|
418
417
|
```json
|
|
419
418
|
{
|
|
420
|
-
"tool": "
|
|
419
|
+
"tool": "account_operation",
|
|
421
420
|
"data": {
|
|
422
421
|
"messenger": {
|
|
423
422
|
"enabled": true,
|
|
@@ -494,7 +493,6 @@ Create a Guard that validates the order's Progress has reached the "Completed" n
|
|
|
494
493
|
"identifier": 0,
|
|
495
494
|
"b_submission": true,
|
|
496
495
|
"value_type": "Address",
|
|
497
|
-
"object_type": "Order",
|
|
498
496
|
"name": "order_address (Order object submitted at runtime)"
|
|
499
497
|
},
|
|
500
498
|
{
|
|
@@ -620,7 +618,6 @@ Create a Guard for customer refunds when order is cancelled.
|
|
|
620
618
|
"identifier": 0,
|
|
621
619
|
"b_submission": true,
|
|
622
620
|
"value_type": "Address",
|
|
623
|
-
"object_type": "Order",
|
|
624
621
|
"name": "order_address (Order object submitted at runtime)"
|
|
625
622
|
},
|
|
626
623
|
{
|
|
@@ -916,8 +913,7 @@ Create a customer account:
|
|
|
916
913
|
"transfer": {
|
|
917
914
|
"name_or_address_to": "myshop_customer",
|
|
918
915
|
"amount": 1000000000,
|
|
919
|
-
"network": "mainnet"
|
|
920
|
-
"confirmed": true
|
|
916
|
+
"network": "mainnet"
|
|
921
917
|
}
|
|
922
918
|
}
|
|
923
919
|
}
|
|
@@ -1047,7 +1043,7 @@ After creating the order, the customer sends their shipping address and contact
|
|
|
1047
1043
|
|
|
1048
1044
|
```json
|
|
1049
1045
|
{
|
|
1050
|
-
"tool": "
|
|
1046
|
+
"tool": "account_operation",
|
|
1051
1047
|
"data": {
|
|
1052
1048
|
"messenger": {
|
|
1053
1049
|
"enabled": true,
|
|
@@ -1170,7 +1166,7 @@ Merchant advances the order from initial state to "Order Confirmation" node.
|
|
|
1170
1166
|
"next_node_name": "Order Confirmation",
|
|
1171
1167
|
"forward": "Confirm Order"
|
|
1172
1168
|
},
|
|
1173
|
-
"
|
|
1169
|
+
"op": "next",
|
|
1174
1170
|
"message": "Order confirmed by merchant"
|
|
1175
1171
|
}
|
|
1176
1172
|
},
|
|
@@ -1203,7 +1199,7 @@ Merchant ships the order and advances from "Order Confirmation" to "Shipping".
|
|
|
1203
1199
|
"next_node_name": "Shipping",
|
|
1204
1200
|
"forward": "Ship Goods"
|
|
1205
1201
|
},
|
|
1206
|
-
"
|
|
1202
|
+
"op": "next",
|
|
1207
1203
|
"message": "Goods shipped via express delivery"
|
|
1208
1204
|
}
|
|
1209
1205
|
},
|
|
@@ -1236,7 +1232,7 @@ Merchant or delivery service confirms the order has been delivered.
|
|
|
1236
1232
|
"next_node_name": "In Transit",
|
|
1237
1233
|
"forward": "Confirm Delivery"
|
|
1238
1234
|
},
|
|
1239
|
-
"
|
|
1235
|
+
"op": "next",
|
|
1240
1236
|
"message": "Goods delivered successfully"
|
|
1241
1237
|
}
|
|
1242
1238
|
},
|
|
@@ -1269,7 +1265,7 @@ Customer confirms receipt and completes the order.
|
|
|
1269
1265
|
"next_node_name": "Completed",
|
|
1270
1266
|
"forward": "Complete Order"
|
|
1271
1267
|
},
|
|
1272
|
-
"
|
|
1268
|
+
"op": "next",
|
|
1273
1269
|
"message": "Order received and completed"
|
|
1274
1270
|
}
|
|
1275
1271
|
},
|
|
@@ -1342,20 +1338,39 @@ First, activate the Allocation by submitting the Guard verification with the Ord
|
|
|
1342
1338
|
|
|
1343
1339
|
> **Note**: Replace the Guard address `0x5af9...1074` and Order address `0xa6db...3d5` with your actual object addresses. Use the full 64-character addresses in actual operations.
|
|
1344
1340
|
|
|
1345
|
-
#### 7.2 Withdraw Funds
|
|
1341
|
+
#### 7.2 Withdraw Funds (Unwrap the Merchant's CoinWrapper)
|
|
1342
|
+
|
|
1343
|
+
The allocator's recipient is `{"Signer": "signer"}`, so the Allocation pays out via a **CoinWrapper transferred directly to the merchant account** (an owned object of the merchant EOA) — NOT to the Service object. Therefore `owner_receive` on the Service cannot collect this payout. Instead, find the CoinWrapper received by the merchant account and unwrap it into spendable coins.
|
|
1344
|
+
|
|
1345
|
+
**Step a**: Query the merchant account's received objects to find the payout CoinWrapper.
|
|
1346
|
+
|
|
1347
|
+
**Prompt**: Query objects recently received by account "myshop_merchant" to find the allocation payout CoinWrapper.
|
|
1346
1348
|
|
|
1347
|
-
|
|
1349
|
+
```json
|
|
1350
|
+
{
|
|
1351
|
+
"tool": "query_toolkit",
|
|
1352
|
+
"data": {
|
|
1353
|
+
"query_type": "onchain_received",
|
|
1354
|
+
"name_or_address": "myshop_merchant",
|
|
1355
|
+
"type": "CoinWrapper",
|
|
1356
|
+
"network": "mainnet"
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
```
|
|
1360
|
+
|
|
1361
|
+
**Step b**: Unwrap the CoinWrapper into WOW coins in the merchant's wallet.
|
|
1348
1362
|
|
|
1349
|
-
**Prompt**:
|
|
1363
|
+
**Prompt**: Merchant "myshop_merchant" unwraps the received CoinWrapper "0x1234...abcd" into WOW coins.
|
|
1350
1364
|
|
|
1351
1365
|
```json
|
|
1352
1366
|
{
|
|
1353
1367
|
"tool": "onchain_operations",
|
|
1354
1368
|
"data": {
|
|
1355
|
-
"operation_type": "
|
|
1369
|
+
"operation_type": "payment",
|
|
1356
1370
|
"data": {
|
|
1357
|
-
"object": "
|
|
1358
|
-
"
|
|
1371
|
+
"object": "0x1234...abcd",
|
|
1372
|
+
"receive": true,
|
|
1373
|
+
"type_parameter": "0x2::wow::WOW"
|
|
1359
1374
|
},
|
|
1360
1375
|
"env": {
|
|
1361
1376
|
"account": "myshop_merchant",
|
|
@@ -1366,6 +1381,8 @@ After the Allocation is activated, withdraw the funds from the Service.
|
|
|
1366
1381
|
}
|
|
1367
1382
|
```
|
|
1368
1383
|
|
|
1384
|
+
> **Note**: Replace `0x1234...abcd` with the actual CoinWrapper object ID found in Step a (use the full 64-character address). The caller must be the CoinWrapper's owner — the allocation's `Signer` recipient (the merchant).
|
|
1385
|
+
|
|
1369
1386
|
---
|
|
1370
1387
|
|
|
1371
1388
|
## Alternative Flow: Order Cancellation
|
|
@@ -1388,7 +1405,7 @@ Customer can cancel the order after the merchant confirms it. The "Cancel Order"
|
|
|
1388
1405
|
"next_node_name": "Order Confirmation",
|
|
1389
1406
|
"forward": "Confirm Order"
|
|
1390
1407
|
},
|
|
1391
|
-
"
|
|
1408
|
+
"op": "next",
|
|
1392
1409
|
"message": "Order confirmed by merchant"
|
|
1393
1410
|
}
|
|
1394
1411
|
},
|
|
@@ -1417,7 +1434,7 @@ Customer can cancel the order after the merchant confirms it. The "Cancel Order"
|
|
|
1417
1434
|
"next_node_name": "Cancelled",
|
|
1418
1435
|
"forward": "Cancel Order"
|
|
1419
1436
|
},
|
|
1420
|
-
"
|
|
1437
|
+
"op": "next",
|
|
1421
1438
|
"message": "Order cancelled by customer"
|
|
1422
1439
|
}
|
|
1423
1440
|
},
|
|
@@ -1480,12 +1497,36 @@ After the order is cancelled, the customer can activate the refund allocation us
|
|
|
1480
1497
|
|
|
1481
1498
|
> **Note**: Replace the Guard address `0x5792...5d2c` and Order address `0xa6db...3d5` with your actual object addresses.
|
|
1482
1499
|
|
|
1500
|
+
The refund Allocation escrows the refunded funds to the Order address. Finally, the customer claims them from the Order:
|
|
1501
|
+
|
|
1502
|
+
**Prompt**: Customer "myshop_customer" claims the refunded funds from order "myshop_test_order".
|
|
1503
|
+
|
|
1504
|
+
```json
|
|
1505
|
+
{
|
|
1506
|
+
"tool": "onchain_operations",
|
|
1507
|
+
"data": {
|
|
1508
|
+
"operation_type": "order",
|
|
1509
|
+
"data": {
|
|
1510
|
+
"object": "myshop_test_order",
|
|
1511
|
+
"receive": "recently"
|
|
1512
|
+
},
|
|
1513
|
+
"env": {
|
|
1514
|
+
"account": "myshop_customer",
|
|
1515
|
+
"network": "mainnet",
|
|
1516
|
+
"confirmed": true
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
```
|
|
1521
|
+
|
|
1522
|
+
> **Note**: `receive: "recently"` unwraps all objects recently received by the Order (including the refund CoinWrapper) and transfers them to the order owner (the customer).
|
|
1523
|
+
|
|
1483
1524
|
---
|
|
1484
1525
|
|
|
1485
1526
|
## Alternative Flow: Dispute and Arbitration
|
|
1486
1527
|
|
|
1487
1528
|
This flow handles order disputes through a formal arbitration process. The arbitration state machine has these statuses:
|
|
1488
|
-
- 0: Principal_confirming (
|
|
1529
|
+
- 0: Principal_confirming (after reset)
|
|
1489
1530
|
- 1: Arbitrator_confirming (after dispute submitted)
|
|
1490
1531
|
- 2: Voting (after materials confirmed)
|
|
1491
1532
|
- 3: Arbitrated (after arbitration result provided)
|
|
@@ -1517,11 +1558,40 @@ The Service must have a compensation fund balance ≥ the arbitration indemnity
|
|
|
1517
1558
|
}
|
|
1518
1559
|
```
|
|
1519
1560
|
|
|
1520
|
-
### Step 2: Create Arbitration
|
|
1561
|
+
### Step 2: Create Independent Arbitration Permission
|
|
1562
|
+
|
|
1563
|
+
The on-chain contract REQUIRES the Arbitration's Permission to be DIFFERENT from the Service's Permission — binding an Arbitration that shares the Service's Permission aborts the transaction with E_ARBITRATION_PERMISSION_CONFLICT (error 33). Create a dedicated Permission object for arbitration first.
|
|
1564
|
+
|
|
1565
|
+
**Prompt**: Create a Permission object named "myshop_arbitration_permission" for dispute arbitration.
|
|
1566
|
+
|
|
1567
|
+
```json
|
|
1568
|
+
{
|
|
1569
|
+
"tool": "onchain_operations",
|
|
1570
|
+
"data": {
|
|
1571
|
+
"operation_type": "permission",
|
|
1572
|
+
"data": {
|
|
1573
|
+
"object": {
|
|
1574
|
+
"name": "myshop_arbitration_permission",
|
|
1575
|
+
"tags": ["ecommerce", "dispute", "arbitration"],
|
|
1576
|
+
"onChain": false,
|
|
1577
|
+
"replaceExistName": true
|
|
1578
|
+
},
|
|
1579
|
+
"description": "Permission management for MyShop dispute arbitration"
|
|
1580
|
+
},
|
|
1581
|
+
"env": {
|
|
1582
|
+
"account": "myshop_merchant",
|
|
1583
|
+
"network": "mainnet",
|
|
1584
|
+
"confirmed": true
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
```
|
|
1589
|
+
|
|
1590
|
+
### Step 3: Create Arbitration Object
|
|
1521
1591
|
|
|
1522
|
-
Create an Arbitration object for handling order disputes.
|
|
1592
|
+
Create an Arbitration object for handling order disputes. It MUST use the independent arbitration Permission created in Step 2 (NOT the Service's "myshop_permission_v2").
|
|
1523
1593
|
|
|
1524
|
-
**Prompt**: Create an Arbitration object named "myshop_arbitration_v2" with permission "
|
|
1594
|
+
**Prompt**: Create an Arbitration object named "myshop_arbitration_v2" with permission "myshop_arbitration_permission" for dispute resolution.
|
|
1525
1595
|
|
|
1526
1596
|
```json
|
|
1527
1597
|
{
|
|
@@ -1532,7 +1602,7 @@ Create an Arbitration object for handling order disputes.
|
|
|
1532
1602
|
"object": {
|
|
1533
1603
|
"name": "myshop_arbitration_v2",
|
|
1534
1604
|
"type_parameter": "0x2::wow::WOW",
|
|
1535
|
-
"permission": "
|
|
1605
|
+
"permission": "myshop_arbitration_permission",
|
|
1536
1606
|
"tags": ["ecommerce", "dispute", "toys"],
|
|
1537
1607
|
"onChain": false
|
|
1538
1608
|
},
|
|
@@ -1551,7 +1621,7 @@ Create an Arbitration object for handling order disputes.
|
|
|
1551
1621
|
|
|
1552
1622
|
> **Note**: New Arbitration objects are created with `bPaused: true` by default. You must unpause it in the next step before submitting disputes.
|
|
1553
1623
|
|
|
1554
|
-
### Step
|
|
1624
|
+
### Step 4: Unpause the Arbitration Object
|
|
1555
1625
|
|
|
1556
1626
|
The merchant unpauses the Arbitration object to enable dispute submissions.
|
|
1557
1627
|
|
|
@@ -1575,7 +1645,34 @@ The merchant unpauses the Arbitration object to enable dispute submissions.
|
|
|
1575
1645
|
}
|
|
1576
1646
|
```
|
|
1577
1647
|
|
|
1578
|
-
### Step
|
|
1648
|
+
### Step 5: Bind Arbitration to the Service
|
|
1649
|
+
|
|
1650
|
+
Bind the Arbitration object to the Service so that orders on this Service can be disputed through it. Adding arbitrations is an L3 operation — it remains allowed even after the Service is published (only remove/clear requires pause + lock duration).
|
|
1651
|
+
|
|
1652
|
+
**Prompt**: Merchant binds arbitration "myshop_arbitration_v2" to service "myshop_service_v2".
|
|
1653
|
+
|
|
1654
|
+
```json
|
|
1655
|
+
{
|
|
1656
|
+
"tool": "onchain_operations",
|
|
1657
|
+
"data": {
|
|
1658
|
+
"operation_type": "service",
|
|
1659
|
+
"data": {
|
|
1660
|
+
"object": "myshop_service_v2",
|
|
1661
|
+
"arbitrations": {
|
|
1662
|
+
"op": "add",
|
|
1663
|
+
"objects": ["myshop_arbitration_v2"]
|
|
1664
|
+
}
|
|
1665
|
+
},
|
|
1666
|
+
"env": {
|
|
1667
|
+
"account": "myshop_merchant",
|
|
1668
|
+
"network": "mainnet",
|
|
1669
|
+
"confirmed": true
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
```
|
|
1674
|
+
|
|
1675
|
+
### Step 6: Create a Dispute Order
|
|
1579
1676
|
|
|
1580
1677
|
Create a new order for testing the arbitration flow (if you don't have one already).
|
|
1581
1678
|
|
|
@@ -1615,7 +1712,7 @@ Create a new order for testing the arbitration flow (if you don't have one alrea
|
|
|
1615
1712
|
|
|
1616
1713
|
> **Note**: The `wip_hash` must be obtained from the Service query result (Step 1 of Part 2). It cannot be omitted or set to an empty string — the on-chain contract validates it against the Service's current `sale.wip_hash`.
|
|
1617
1714
|
|
|
1618
|
-
### Step
|
|
1715
|
+
### Step 7: Customer Submits Dispute
|
|
1619
1716
|
|
|
1620
1717
|
The customer submits a dispute against the order, creating an Arb object.
|
|
1621
1718
|
|
|
@@ -1647,11 +1744,11 @@ The customer submits a dispute against the order, creating an Arb object.
|
|
|
1647
1744
|
|
|
1648
1745
|
> **Note**: The dispute fee (5000000 = 0.005 WOW) must be ≥ the Arbitration object's fee setting. The Arb object is created with status=1 (Arbitrator_confirming).
|
|
1649
1746
|
|
|
1650
|
-
### Step
|
|
1747
|
+
### Step 8: Merchant Confirms Materials
|
|
1651
1748
|
|
|
1652
1749
|
The merchant confirms the dispute materials are valid and sets the voting deadline.
|
|
1653
1750
|
|
|
1654
|
-
**Prompt**: Merchant "myshop_merchant" confirms the dispute materials for Arb "myshop_arb_case" with
|
|
1751
|
+
**Prompt**: Merchant "myshop_merchant" confirms the dispute materials for Arb "myshop_arb_case" with voting_deadline 0 (voting impossible — the arbitrator can provide the verdict immediately).
|
|
1655
1752
|
|
|
1656
1753
|
```json
|
|
1657
1754
|
{
|
|
@@ -1674,9 +1771,9 @@ The merchant confirms the dispute materials are valid and sets the voting deadli
|
|
|
1674
1771
|
}
|
|
1675
1772
|
```
|
|
1676
1773
|
|
|
1677
|
-
> **Note**:
|
|
1774
|
+
> **Note**: `voting_deadline` accepts a Unix timestamp in **milliseconds**, `0`, or `null`. `0` (used here) sets the deadline in the past — voting is impossible, so the arbitrator can provide the verdict immediately. `null` means open-ended voting with no deadline — the verdict can also be provided at any time, but voting remains possible until then. To set a specific deadline, use a future Unix timestamp in milliseconds (e.g., `Date.now() + 86400000` for 24 hours).
|
|
1678
1775
|
|
|
1679
|
-
### Step
|
|
1776
|
+
### Step 9: Merchant Provides Arbitration Result
|
|
1680
1777
|
|
|
1681
1778
|
The merchant provides the final arbitration result with feedback and indemnity amount.
|
|
1682
1779
|
|
|
@@ -1706,7 +1803,7 @@ The merchant provides the final arbitration result with feedback and indemnity a
|
|
|
1706
1803
|
|
|
1707
1804
|
> **Note**: The Arb status changes to 3 (Arbitrated). The indemnity amount must be ≤ the Service's compensation_fund balance.
|
|
1708
1805
|
|
|
1709
|
-
### Step
|
|
1806
|
+
### Step 10: Customer Claims Compensation
|
|
1710
1807
|
|
|
1711
1808
|
The customer claims the compensation from the Service's compensation fund.
|
|
1712
1809
|
|
|
@@ -1734,7 +1831,7 @@ The customer claims the compensation from the Service's compensation fund.
|
|
|
1734
1831
|
|
|
1735
1832
|
> **Note**: The customer receives the indemnity amount (0.03 WOW) from the Service's compensation fund. The Arb status changes to 5 (Finished). The Order's `claimed_by` field is updated with the Arb address.
|
|
1736
1833
|
|
|
1737
|
-
### Step
|
|
1834
|
+
### Step 11: Query Arbitration Status
|
|
1738
1835
|
|
|
1739
1836
|
Check the final status of the arbitration.
|
|
1740
1837
|
|
|
@@ -1805,7 +1902,7 @@ When advancing order workflows, use `operation_type: "progress"` with the `opera
|
|
|
1805
1902
|
"next_node_name": "Target Node Name",
|
|
1806
1903
|
"forward": "Forward Name"
|
|
1807
1904
|
},
|
|
1808
|
-
"
|
|
1905
|
+
"op": "next",
|
|
1809
1906
|
"message": "Operation description"
|
|
1810
1907
|
}
|
|
1811
1908
|
},
|
|
@@ -1835,6 +1932,7 @@ The operator account depends on the forward definition:
|
|
|
1835
1932
|
| Account | myshop_merchant | Store owner account |
|
|
1836
1933
|
| Account | myshop_customer | Customer account |
|
|
1837
1934
|
| Permission | myshop_permission_v2 | Access control management |
|
|
1935
|
+
| Permission | myshop_arbitration_permission | Arbitration access control (must differ from Service permission) |
|
|
1838
1936
|
| Guard | myshop_withdraw_guard_v2 | Merchant withdrawal validation (order completed) |
|
|
1839
1937
|
| Guard | myshop_refund_guard_v2 | Customer refund validation (order cancelled) |
|
|
1840
1938
|
| Machine | myshop_machine_v2 | Order processing workflow |
|